13.3.2 Elements below persistence-unit-metadata
- Organization of this subsection
(1) <persistence-unit-metadata>
Specifies the definition related to the entire PersistenceUnit.
(2) <xml-mapping-metadata-complete>
If you specify the xml-mapping-metadata-complete element, the mapping metadata of the persistence unit is controlled and the annotations specified in the class are ignored.
If the xml-mapping-metadata-complete element is specified and the XML element is omitted, the default value is enabled.
- Precautions
-
If you specify this element when an annotation is specified, the KDJE55532-W message is output.
(3) <persistence-unit-defaults>
Specifies the default value of the persistence unit.
(4) <schema>
The schema element applies to all entity classes, table generators, and join tables in the persistence unit.
The schema element is overwritten by the following elements and attributes:
-
The schema element of the entity-mappings element.
-
The schema attributes explicitly specified in @Table and @SecondaryTable of the entity class.
-
The schema attributes specified in the table element and secondary-table element of the entity element.
-
The schema elements explicitly specified in the @TableGenerator and table-generator element.
-
The schema elements explicitly specified in the @JoinTable and join-table element.
(5) <catalog>
The catalog element applies to all entity classes, table generators, and join tables in the persistence unit.
The catalog element is overwritten by the following elements and attributes:
-
The catalog element of the entity-mappings element.
-
The catalog attributes explicitly specified in @Table and @SecondaryTable of the entity class.
-
The catalog attributes specified in the table element and secondary-table element of the entity element.
-
The catalog elements explicitly specified in the @TableGenerator and table-generator element.
-
The catalog elements explicitly specified in the @JoinTable and join-table element.
- Precautions
-
The catalog element does not exist in the Oracle and HiRDB databases supported in Cosminexus JPA Provider. Therefore, you cannot specify the catalog element. If specified, an exception will be thrown when the application is executed.
(6) <access>
The access element applies to all the managed classes in the persistence unit.
The access element is overwritten by the following annotations, elements, and attributes:
-
The access type determined on the basis of the location in which the entity class annotations are specified.
-
The access element of the entity-mappings element.
-
The access attributes defined in the entity element, mapped-superclass element, and embeddable element.
- Precautions
-
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.
(7) <cascade-persist>
The cascade-persist element applies to all the relationships in the persistence unit.
In addition to the values specified in annotations or O/R mapping files, the specification of the cascade-persist element adds the cascade persistence option to all the relationships.
- Precautions
-
If you specify the cascade-persist element, you cannot overwrite and disable.
(8) <entity-listeners>
The entity-listeners element defines the default entity listeners of the persistence unit.
For details on the functionality and attributes, see 8.12 javax.persistence package.