The following elements and attributes apply only to the entity class that is the target of the lower elements and attributes:
The entity element defines the entities of the persistence unit.
For details about the functionality and attributes, see section 2.7 javax.persistence package in the manual uCosminexus Application Server API Reference Guide.
The following table lists the specifiable attributes:
Table 6-25 Attributes of <entity>
Attribute name | Type | Optional/Required | Description |
---|---|---|---|
name | xsd:string | Optional | The name attribute defines the name of the entity. The name attribute is overwritten regardless of whether the entity name defined by the name element of @Entity is explicitly specified or is the default value. The operation when the entity class name is overwritten might not execute normally. |
class | xsd:string | Required | Entity class name. |
access | orm:access-type | Optional | The access attribute defines the access type of the entity class. The access attribute overwrites the access type specified in the persistence-unit-defaults element (default element) and entity-mappings element (element valid for the entire persistence unit) provided to the entity class.#1 |
metadata-complete#2 | xsd:boolean | Optional | If the metadata-complete attribute is specified in the entity element, the annotations specified in the entity class and in the fields and properties of the entity class are ignored. If metadata-complete is specified in the entity element and if the XML element is omitted, the default value is enabled. |
The table element overwrites @Table (including default values) of the entity class.
For details about the functionality and attributes, see section 2.7 javax.persistence package in the manual uCosminexus Application Server API Reference Guide.
The following table lists the specifiable attributes:
Table 6-26 Attributes of <table>
Attribute name | Type | Optional/Required | Description |
---|---|---|---|
name | xsd:string | Optional | See the name attribute in 2.7.59 @Table in the manual uCosminexus Application Server API Reference Guide. |
catalog | xsd:string | Optional | See the catalog attribute in 2.7.59 @Table in the manual uCosminexus Application Server API Reference Guide. |
schema | xsd:string | Optional | See the schema attribute in 2.7.59 @Table in the manual uCosminexus Application Server API Reference Guide. |
The secondary-table element overwrites all @SecondaryTable and @SecondaryTables (including default values) of the entity class.
For details about the functionality and attributes, see section 2.7 javax.persistence package in the manual uCosminexus Application Server API Reference Guide.
The following table lists the specifiable attributes:
Table 6-27 Attributes of <secondary-table>
Attribute name | Type | Optional/Required | Description |
---|---|---|---|
name | xsd:string | Required | See the name attribute in 2.7.54 @SecondaryTable in the manual uCosminexus Application Server API Reference Guide. |
catalog | xsd:string | Optional | See the catalog attribute in 2.7.54 @SecondaryTable in the manual uCosminexus Application Server API Reference Guide. |
schema | xsd:string | Optional | See the schema attribute in 2.7.54 @SecondaryTable in the manual uCosminexus Application Server API Reference Guide. |
The primary-key-join-column element overwrites all @PrimaryKeyJoinColumn and @PrimaryKeyJoinColumns (including default values) of the entity class.
For details about the functionality and attributes, see section 2.7 javax.persistence package in the manual uCosminexus Application Server API Reference Guide.
The following table lists the specifiable attributes:
Table 6-28 Attributes of <primary-key-join-column>
Attribute name | Type | Optional/Required | Description |
---|---|---|---|
name | xsd:string | Optional | See the name attribute in 2.7.51 @PrimaryKeyJoinColumn in the manual uCosminexus Application Server API Reference Guide. |
referenced-column-name | xsd:string | Optional | See the referencedColumnName attribute in 2.7.51 @PrimaryKeyJoinColumn in the manual uCosminexus Application Server API Reference Guide. |
column-definition | xsd:string | Optional | See the columnDefinition attribute in 2.7.51 @PrimaryKeyJoinColumn in the manual uCosminexus Application Server API Reference Guide. |
The id-class element overwrites @IdClass specified in the entity class.
For details about the functionality and attributes, see section 2.7 javax.persistence package in the manual uCosminexus Application Server API Reference Guide.
The following table lists the specifiable attributes:
Table 6-29 Attributes of <id-class>
Attribute name | Type | Optional/Required | Description |
---|---|---|---|
class | xsd:string | Required | See the value attribute in 2.7.22 @IdClass in the manual uCosminexus Application Server API Reference Guide. |
The inheritance element overwrites @Inheritance (including default values) of the entity class.
The inheritance element will be applied to the entity class and the sub class (if the sub class specified in the annotation and XML element is not overwritten using another method).
For details about the functionality and attributes, see section 2.7 javax.persistence package in the manual uCosminexus Application Server API Reference Guide.
The following table lists the specifiable attributes:
Table 6-30 Attributes of <inheritance>
Attribute name | Type | Optional/Required | Description |
---|---|---|---|
strategy | orm:inheritance-type | Optional | See the strategy attribute in 2.7.23 @Inheritance in the manual uCosminexus Application Server API Reference Guide. |
The discriminator-value element overwrites @DiscriminatorValue (including default values) of the entity class.
For details about the functionality and attributes, see section 2.7 javax.persistence package in the manual uCosminexus Application Server API Reference Guide.
The discriminator-column element overwrites @DiscriminatorColumn (including default values) of the entity class.
The discriminator-column element will be applied to the entity class and the sub class (if the sub class specified in the annotation and XML element is not overwritten using another method).
For details about the functionality and attributes, see section 2.7 javax.persistence package in the manual uCosminexus Application Server API Reference Guide.
The following table lists the specifiable attributes:
Table 6-31 Attributes of <discriminator-column>
Attribute name | Type | Optional/Required | Description |
---|---|---|---|
name | xsd:string | Optional | See the name attribute in 2.7.8 @DiscriminatorColumn in the manual uCosminexus Application Server API Reference Guide. |
discriminator-type | orm:discriminator-type | Optional | See the discriminatorType attribute in 2.7.8 @DiscriminatorColumn in the manual uCosminexus Application Server API Reference Guide. |
column-definition | xsd:string | Optional | See the columnDefinition attribute in 2.7.8 @DiscriminatorColumn in the manual uCosminexus Application Server API Reference Guide. |
length | xsd:int | Optional | See the length attribute in 2.7.8 @DiscriminatorColumn in the manual uCosminexus Application Server API Reference Guide. |
The generator defined by the sequence-generator element is added to the generators defined using annotations and the other generators defined in the O/R mapping file. If a generator with the same name is defined in the annotation, the generator defined by the sequence-generator element overwrites this generator.
The generator defined by the sequence-generator element applies to the persistence unit.
For details about the functionality and attributes, see section 2.7 javax.persistence package in the manual uCosminexus Application Server API Reference Guide.
The following table lists the specifiable attributes:
Table 6-32 Attributes of <sequence-generator>
Attribute name | Type | Optional/Required | Description |
---|---|---|---|
name | xsd:string | Required | See the name attribute in 2.7.56 @SequenceGenerator in the manual uCosminexus Application Server API Reference Guide. |
sequence-name | xsd:string | Optional | See the sequenceName attribute in 2.7.56 @SequenceGenerator in the manual uCosminexus Application Server API Reference Guide. |
initial-value | xsd:int | Optional | See the initialValue attribute in 2.7.56 @SequenceGenerator in the manual uCosminexus Application Server API Reference Guide. |
allocation-size | xsd:int | Optional | See the name attribute in 2.7.56 @SequenceGenerator in the manual uCosminexus Application Server API Reference Guide. |
The generator defined by the table-generator element is added to the generators defined using annotations and the other generators defined in the O/R mapping file. If a generator with the same name is defined in the annotation, the generator defined by the table-generator element overwrites this generator.
The generators defined by the table-generator element will be applied to the persistence unit.
For details about the functionality and attributes, see section 2.7 javax.persistence package in the manual uCosminexus Application Server API Reference Guide.
The following table lists the specifiable attributes:
Table 6-33 Attributes of <table-generator>
Attribute name | Type | Optional/Required | Description |
---|---|---|---|
name | xsd:string | Required | See the name attribute in 2.7.60 @TableGenerator in the manual uCosminexus Application Server API Reference Guide. |
table | xsd:string | Optional | See the table attribute in 2.7.60 @TableGenerator in the manual uCosminexus Application Server API Reference Guide. |
catalog | xsd:string | Optional | See the catalog attribute in 2.7.60 @TableGenerator in the manual uCosminexus Application Server API Reference Guide. |
schema | xsd:string | Optional | See the schema attribute in 2.7.60 @TableGenerator in the manual uCosminexus Application Server API Reference Guide. |
pk-column-name | xsd:string | Optional | See the pkColumnName attribute in 2.7.60 @TableGenerator in the manual uCosminexus Application Server API Reference Guide. |
value-column-name | xsd:string | Optional | See the valueColumnName attribute in 2.7.60 @TableGenerator in the manual uCosminexus Application Server API Reference Guide. |
pk-column-value | xsd:string | Optional | See the pkColumnValue attribute in 2.7.60 @TableGenerator in the manual uCosminexus Application Server API Reference Guide. |
initial-value | xsd:int | Optional | See the initialValueattribute in2.7.60 @TableGenerator in the manual uCosminexus Application Server API Reference Guide. |
allocation-size | xsd:int | Optional | See the allocationSize attribute in 2.7.60 @TableGenerator in the manual uCosminexus Application Server API Reference Guide. |
The named query defined by the named-query element is added to the named query defined using annotations and the other named queries defined in the O/R mapping file. If a named query with the same name is defined in the annotation, the named query defined by the named-query element overwrites this named query.
The named query defined by the named-query element applies to the persistence unit.
For details about the functionality and attributes, see section 2.7 javax.persistence package in the manual uCosminexus Application Server API Reference Guide.
The following table lists the specifiable attributes:
Table 6-34 Attributes of <named-query>
Attribute name | Type | Optional/Required | Description |
---|---|---|---|
name | xsd:string | Required | See the name attribute in 2.7.35 @NamedQuery in the manual uCosminexus Application Server API Reference Guide. |
The named native query defined by the named-native-query element is added to the named native query defined using annotations and the other named native queries defined in the O/R mapping file. If a named native query with the same name is defined in the annotation, the named native query defined by the named-native-query element overwrites this named native query.
The named native query defined by the named-native-query element applies to the persistence unit.
For details about the functionality and attributes, see section 2.7 javax.persistence package in the manual uCosminexus Application Server API Reference Guide.
The following table lists the specifiable attributes:
Table 6-35 Attributes of <named-native-query>
Attribute name | Type | Optional/Required | Description |
---|---|---|---|
name | xsd:string | Required | See the name attribute in 2.7.33 @NamedNativeQuery in the manual uCosminexus Application Server API Reference Guide. |
result-class | xsd:string | Optional | See the resultClass attribute in 2.7.33 @NamedNativeQuery in the manual uCosminexus Application Server API Reference Guide. |
result-set-mapping | xsd:string | Optional | See the resultSetMapping attribute in 2.7.33 @NamedNativeQuery in the manual uCosminexus Application Server API Reference Guide. |
The SQL result mapping defined by the sql-result-set-mapping element is added to the SQL result mapping defined using annotations and the other SQL result mapping defined in the O/R mapping file. If SQL result mapping with the same name is defined in the annotation, the SQL result mapping defined in the sql-result-set-mapping element overwrites this SQL result mapping.
The SQL result mapping defined by the sql-result-set-mapping element applies to the persistence unit.
For details about the functionality and attributes, see section 2.7 javax.persistence package in the manual uCosminexus Application Server API Reference Guide.
The following table lists the specifiable attributes:
Table 6-36 Attributes of <sql-result-set-mapping>
Attribute name | Type | Optional/Required | Description |
---|---|---|---|
name | xsd:string | Required | See the name attribute in 2.7.57 @SqlResultSetMapping in the manual uCosminexus Application Server API Reference Guide. |
The exclude-default-listeners element is applied regardless of whether @ExcludeDefaultListeners is specified in the entity class.
The exclude-default-listeners element controls the default entity listeners of the entity class and the sub class.
For details about the functionality and attributes, see section 2.7 javax.persistence package in the manual uCosminexus Application Server API Reference Guide.
The exclude-superclass-listeners element is applied regardless of whether @ExcludeSuperclassListeners is specified in the entity class.
The exclude-superclass-listeners element controls the superclass listeners of the entity class and the sub class.
For details about the functionality and attributes, see section 2.7 javax.persistence package in the manual uCosminexus Application Server API Reference Guide.
The entity-listeners element overwrites @EntityListeners of the entity class.
If these listeners are not controlled using other methods, these listeners will be applied in the entity class and the sub class.
For details about the functionality and attributes, see section 2.7 javax.persistence package in the manual uCosminexus Application Server API Reference Guide.
These elements overwrite the definition of the lifecycle callback method according to the corresponding annotations, in the entity class.
For details about the functionality and attributes, see section 2.7 javax.persistence package in the manual uCosminexus Application Server API Reference Guide.
The following table lists the specifiable attributes:
Table 6-37 Attributes of <pre-persist>, <post-persist>, <pre-remove>, <post-remove>, <pre-update>, <post-update>, and <post-load>
Attribute name | Type | Optional/Required | Description |
---|---|---|---|
method-name | xsd:string | Required | Target method name. |
The attribute-override element is added to the value defined in @AttributeOverride or @AttributeOverrides of the entity class. The attribute-override element overwrites the AttributeOverride element with the same attribute name.
For details about the functionality and attributes, see section 2.7 javax.persistence package in the manual uCosminexus Application Server API Reference Guide.
The following table lists the specifiable attributes:
Table 6-38 Attributes of <attribute-override>
Attribute name | Type | Optional/Required | Description |
---|---|---|---|
name | xsd:string | Required | See the name attribute in 2.7.3 @AttributeOverride in the manual uCosminexus Application Server API Reference Guide. |
The association-override element is added to the value defined in @AssociationOverride or @AssociationOverrides of the entity class. The association-override element overwrites the AssociationOverride element with the same attribute name.
For details about the functionality and attributes, see section 2.7 javax.persistence package in the manual uCosminexus Application Server API Reference Guide.
The following table lists the specifiable attributes:
Table 6-39 Attributes of <association-override>
Attribute name | Type | Optional/Required | Description |
---|---|---|---|
name | xsd:string | Required | See the name attribute in 2.7.1 @AssociationOverride in the manual uCosminexus Application Server API Reference Guide. |
The id element overwrites the mapping specified in fields and properties.
For details about the functionality and attributes, see section 2.7 javax.persistence package in the manual uCosminexus Application Server API Reference Guide.
The following table lists the specifiable attributes:
Table 6-40 Attributes of <id>
Attribute name | Type | Optional/Required | Description |
---|---|---|---|
name | xsd:string | Required | Primary key property or field. |
The embedded-id element overwrites the mapping specified in fields and properties.
For details about the functionality and attributes, see section 2.7 javax.persistence package in the manual uCosminexus Application Server API Reference Guide.
The following table lists the specifiable attributes:
Table 6-41 Attributes of <embedded-id>
Attribute name | Type | Optional/Required | Description |
---|---|---|---|
name | xsd:string | Required | Compound primary key. |
The basic element overwrites the mapping specified in fields and properties.
For details about the functionality and attributes, see section 2.7 javax.persistence package in the manual uCosminexus Application Server API Reference Guide.
The following table lists the specifiable attributes:
Table 6-42 Attributes of <basic>
Attribute name | Type | Optional/Required | Description |
---|---|---|---|
name | xsd:string | Required | Methods or fields that map the type. |
fetch | orm:fetch-type | Optional | See the fetch attribute in 2.7.5 @Basic in the manual uCosminexus Application Server API Reference Guide. |
optional | xsd:boolean | Optional | See the optional attribute in 2.7.5 @Basic in the manual uCosminexus Application Server API Reference Guide. |
The version element overwrites the mapping specified in fields and properties.
For details about the functionality and attributes, see section 2.7 javax.persistence package in the manual uCosminexus Application Server API Reference Guide.
The following table lists the specifiable attributes:
Table 6-43 Attributes of <version>
Attribute name | Type | Optional/Required | Description |
---|---|---|---|
name | xsd:string | Required | Version property or field. |
The many-to-one element overwrites the mapping specified in fields and properties.
For details about the functionality and attributes, see section 2.7 javax.persistence package in the manual uCosminexus Application Server API Reference Guide.
The following table lists the specifiable attributes:
Table 6-44 Attributes of <many-to-one>
Attribute name | Type | Optional/Required | Description |
---|---|---|---|
name | xsd:string | Required | Methods or fields with a many-to-one relationship. |
target-entity | xsd:string | Optional | See the targetEntity attribute in 2.7.29 @ManyToOne in the manual uCosminexus Application Server API Reference Guide. |
fetch | orm:fetch-type | Optional | See the fetch attribute in 2.7.29 @ManyToOne in the manual uCosminexus Application Server API Reference Guide. |
optional | xsd:boolean | Optional | See the optional attribute in 2.7.29 @ManyToOne in the manual uCosminexus Application Server API Reference Guide. |
The one-to-many element overwrites the mapping specified in fields and properties.
For details about the functionality and attributes, see section 2.7 javax.persistence package in the manual uCosminexus Application Server API Reference Guide.
The following table lists the specifiable attributes:
Table 6-45 Attributes of <one-to-many>
Attribute name | Type | Optional/Required | Description |
---|---|---|---|
name | xsd:string | Required | Methods or fields with a one-to-many relationship. |
target-entity | xsd:string | Optional | See the targetEntity attribute in 2.7.36 @OneToMany in the manual uCosminexus Application Server API Reference Guide. |
fetch | orm:fetch-type | Optional | See the fetch attribute in 2.7.36 @OneToMany in the manual uCosminexus Application Server API Reference Guide. |
mapped-by | xsd:string | Optional | See the mappedBy attribute in 2.7.36 @OneToMany in the manual uCosminexus Application Server API Reference Guide. |
The one-to-one element overwrites the mapping specified in fields and properties.
For details about the functionality and attributes, see section 2.7 javax.persistence package in the manual uCosminexus Application Server API Reference Guide.
The following table lists the specifiable attributes:
Table 6-46 Attributes of <one-to-one>
Attribute name | Type | Optional/Required | Description |
---|---|---|---|
name | xsd:string | Required | Methods or fields with a one-to-one relationship. |
target-entity | xsd:string | Optional | See the targetEntity attribute in 2.7.37 @OneToOne in the manual uCosminexus Application Server API Reference Guide. |
fetch | orm:fetch-type | Optional | See the fetch attribute in 2.7.37 @OneToOne in the manual uCosminexus Application Server API Reference Guide. |
optional | xsd:boolean | Optional | See the optional attribute in 2.7.37 @OneToOne in the manual uCosminexus Application Server API Reference Guide. |
mapped-by | xsd:string | Optional | See the mappedBy attribute in 2.7.37 @OneToOne in the manual uCosminexus Application Server API Reference Guide. |
The many-to-many element overwrites the mapping specified in fields and properties.
For details about the functionality and attributes, see section 2.7 javax.persistence package in the manual uCosminexus Application Server API Reference Guide.
The following table lists the specifiable attributes:
Table 6-47 Attributes of <many-to-many>
Attribute name | Type | Optional/Required | Description |
---|---|---|---|
name | xsd:string | Required | Methods or fields with a many-to-many relationship. |
target-entity | xsd:string | Optional | See the targetEntity attribute in 2.7.28 @ManyToMany in the manual uCosminexus Application Server API Reference Guide. |
fetch | orm:fetch-type | Optional | See the fetch attribute in 2.7.28 @ManyToMany in the manual uCosminexus Application Server API Reference Guide. |
mapped-by | xsd:string | Optional | See the mappedBy attribute in 2.7.28 @ManyToMany in the manual uCosminexus Application Server API Reference Guide. |
The embedded element overwrites the mapping specified in fields and properties.
For details about the functionality and attributes, see section 2.7 javax.persistence package in the manual uCosminexus Application Server API Reference Guide.
The following table lists the specifiable attributes:
Table 6-48 Attributes of <embedded>
Attribute name | Type | Optional/Required | Description |
---|---|---|---|
name | xsd:string | Required | Property or field that is an embedded object. |
The transient element overwrites the mapping specified in fields and properties.
For details about the functionality and attributes, see section 2.7 javax.persistence package in the manual uCosminexus Application Server API Reference Guide.
The following table lists the specifiable attributes:
Table 6-49 Attributes of <transient>
Attribute name | Type | Optional/Required | Description |
---|---|---|---|
name | xsd:string | Required | Property or field that is non-persistent. |