Salesforce

Hibernate Data Sources (Magic xpa 4.x)

« Go Back

Information

 
Created BySalesforce Service User
Approval Process StatusPublished
Objective
Description

Hibernate Data Sources (Magic xpa 4.x)

Hibernate is an Object/Relational Mapping (ORM) framework that helps map Java objects to almost all of the relational database tables, including Java data types to SQL data types and vice versa.

To define data sources as Hibernate data sources in Magic xpa, follow the steps below:

  1. Change the database of the required data sources to the Space database. (You can change it in the original data source or copy the original data source and change the copy). As a result of the change, the storage types might be changed.

  2. Optional: Add a package name to the data source name (for example: ‘com.myorg.employees’). This package will be created in the space. You can leave its original name if you want.

  3. Run the Hibernate Data Source Builder from the Options menu. In the builder, you can choose the required data sources and define the deployment database connection details. The result of the builder is a Java file (JAR) that deploys a space with the required data source objects.

  4. Open the GigaSpaces-xpa\bin\DeployDatabaseSpace.bat file in a text editor and replace the MgxpaDBSpace.jar with the result jar name (for example: MgxpaDBSpaceHibernate.jar).

  5. If you placed the result file in a folder other than the GigaSpaces-xpa\lib\database folder, you also need to change the folder in the bat file.

  6. Restart the space.

  • To deploy a space with hibernated data source objects, the data sources must be defined first in the SQL database and have at least one record.

  • A Space data source must include at least one unique index with only one column.

Exceptions:

  • The data source name or column name cannot start with an upper case letter followed by a lower case letter. When changing a database of a data source to a Space database, the first letter in the data source name or column name will automatically be changed to lower case.

  • The data source name or column name cannot contain special characters. When changing a database of a data source to a space database, the special characters will be replaced by an underscore and the original name will be written in the Database Information property or Information for SQL Database property. The original name will be used by the Hibernate Data Source Builder to define the name in the relational database.

  • If a column was previously defined with the Type column property set to IDENTITY and this column is used as the unique index column, when creating a new record, you need to set a value in this column.

  • Hibernate is not supported for embedded spaces.

Reference
Attachment 
Attachment