13.3.1 Elements below entity-mappings
- Organization of this subsection
(1) <entity-mappings>
Indicates the root tag.
The following table lists the specifiable attributes:
Attribute name |
Type |
Optional/Required |
Description |
---|---|---|---|
version |
orm:versionType |
Required |
Specifies the JPA version. |
(2) <package>
The package element specifies the class package described in the elements and attributes within the same mapping file. In the package element, the class name with a package name is specified for a class, and if the name differs from the package name specified in the package element, the package name is overwritten.
(3) <schema>
The schema element only applies to the entities that are specified within the same mapping file.
The schema element is overwritten by the following elements and attributes:
-
The schema elements explicitly specified in @Table and @SecondaryTable of the entity class specified in the mapping file.
-
The schemaAttributes of the table element and the secondary-table element defined in the entity element.
(4) <catalog>
The catalog element only applies to the entities specified within the same mapping file.
The catalog element is overwritten by the following elements and attributes:
-
The catalog element explicitly specified in @Table and @SecondaryTable of the entity class specified in the mapping file.
-
The catalog attributes of the table lower element and the secondary-table lower element defined in the entity element.
- Precautions
-
Depending upon a database, the catalog element might not exist. The catalog element does not exist in Oracle and HiRDB databases supported by the Cosminexus JPA Provider. Therefore, you cannot specify the catalog element. If specified, an exception will be thrown when you execute the application.
(5) <access>
The access element applies to the classes that are specified and managed within the same mapping file.
The access element is overwritten by the following annotations and attributes:
-
The access type determined on the basis of the location in which the entity class annotations are specified.
-
The access attributes defined in the entity element, the mapped-superclass element, and the embeddable element.
# Specify PROPERTY or FIELD as the specified value. For details on how to specify access methods for entity class fields, see 9.12.3 Specifying the access methods for the entity class fields.
(6) <sequence-generator>
Adds the sequence generator.
For details on the functionality and attributes, see 8.12 javax.persistence package.
The following table lists the specifiable attributes:
Attribute name |
Type |
Optional/Required |
Description |
---|---|---|---|
name |
xsd:string |
Required |
See the name attribute in 8.12.56 @SequenceGenerator. |
sequence-name |
xsd:string |
Optional |
See the sequenceName attribute in 8.12.56 @SequenceGenerator. |
initial-value |
xsd:int |
Optional |
See the initialValue attribute in 8.12.56 @SequenceGenerator. |
allocation-size |
xsd:int |
Optional |
See the allocationSize attribute in 8.12.56 @SequenceGenerator. |