Entering content frame

Function documentation Mapping Persistent Classes to Database Tables Locate the document in its SAP Library structure

Use

The SAP implementation of the JDO (Java Data Objects) standard addresses relational databases as a data store. This section describes the object-relational options that are available and how you can use them in your applications.

Features

Mapping Metadata

The metadata describing the object-relational mapping (called mapping metadata below) is stored in XML format. The mapping metadata must be contained within a file. If the mapping metadata is for a persistence capable class only, then its file name should be <class-name>.map and the location of the file must be the same as the location of the class file of the persistence capable class. If the mapping metadata is for a package, then its file name should be <package-name>.map and the location of the file must be the same as the location of the package. 

For more information about the document type definition, see Structure linkJDO Mapping Metadata DTD in the Reference Manual.

Default Fetch Groups and Relationship Fields

Default fetch groups define fields that are fetched and stored together.

Default fetch groups fields (called DFG fields below) are fetched and updated with a single SQL statement (if they are mapped to one table). Non-DFG fields are each fetched and updated by a separate SQL statement. When they are inserted, one single SQL statement for all fields is used (if they are mapped to one table).

Relationship fields are always fetched and updated by a separate SQL statement, regardless whether they are a DFG field. Therefore, it is not reasonable to put relationship fields in the default fetch group. There is only one exception to this: relationship fields with multiplicity one in one-to-many or many-to-one relationships belonging to the default fetch group are fetched and updated with the other DFG fields.

If an instance is fetched from the database as a consequence of a query, then the DFG fields are loaded completely. If an instance is fetched by navigation, then only the primary key fields are loaded. The first time a DFG field is accessed, all the DFG fields are loaded.

 

See also:

Mapping Primitive Fields

Mapping Relationship Fields

Mapping Relationship Fields with Generic Types

Inheritance Mapping

Type Mapping

 

Leaving content frame