uCosminexus Application Server, Definition Reference Guide

[Contents][Index][Back][Next]

6.3.7 Elements below mapped-superclass

The following elements and attributes apply only to the mapped superclass that is the target of the elements and attributes:

Organization of this subsection
(1) <mapped-superclass>
(2) <id-class>
(3) <exclude-default-listeners>
(4) <exclude-superclass-listeners>
(5) <entity-listeners>
(6) <pre-persist>, <post-persist>, <pre-remove>, <post-remove>, <pre-update>, <post-update>, <post-load>
(7) <id>
(8) <embedded-id>
(9) <basic>
(10) <version>
(11) <many-to-one>
(12) <one-to-many>
(13) <one-to-one>
(14) <many-to-many>
(15) <embedded>
(16) <transient>

(1) <mapped-superclass>

The mapped-superclass element defines the mapped superclass 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-12 Attributes of <mapped-superclass>

Attribute name Type Optional/Required Description
class xsd:string Required Class name of the mapped superclass.
access orm:access-type Optional The access attribute defines the access type of the mapped superclass. 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 mapped superclass.#1
metadata-complete#2 xsd:boolean Optional If the metadata-complete attribute is specified in the mapped-superclass element, the annotations specified in the mapped superclass and in the fields and properties of the mapped superclass are ignored.
If metadata-complete is specified in the mapped-superclass element and if the XML element is omitted, the default value is enabled.

#1
Specify PROPERTY or FIELD as the specified value. For details on specifying how to access the entity class fields, see 6.12.3 Specifying how to access the entity class fields in the manual uCosminexus Application Server Common Container Functionality Guide.

#2
If you specify this element when an annotation is specified, the KDJE55532-W message is output.

(2) <id-class>

The id-class element overwrites @IdClass specified in the mapped superclass.

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-13 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.

(3) <exclude-default-listeners>

The exclude-default-listeners element is applied regardless of whether @ExcludeDefaultListeners is specified in the mapped superclass.

The exclude-default-listeners element controls the default entity listeners of the mapped superclass 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.

(4) <exclude-superclass-listeners>

The exclude-superclass-listeners element is applied regardless of whether @ExcludeSuperclassListeners is specified in the mapped superclass.

The exclude-superclass-listeners element controls the superclass listeners of the mapped superclass 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.

(5) <entity-listeners>

The entity-listeners element overwrites @EntityListeners of the mapped superclass.

If these listeners are not controlled using other methods, these listeners will be applied in the mapped superclass 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.

(6) <pre-persist>, <post-persist>, <pre-remove>, <post-remove>, <pre-update>, <post-update>, <post-load>

These elements overwrite the definition of the lifecycle callback method according to the corresponding annotations, in the mapped superclass.

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-14 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.

(7) <id>

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-15 Attributes of <id>

Attribute name Type Optional/Required Description
name xsd:string Required Specifies a primary key property or field.

(8) <embedded-id>

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-16 Attributes of <embedded-id>

Attribute name Type Optional/Required Description
name xsd:string Required Specifies a compound primary key.

(9) <basic>

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-17 Attributes of <basic>

Attribute name Type Optional/Required Description
name xsd:string Required Specifies the methods and fields that map the type.
fetch orm:fetch-type Optional Specifies the value of the Fetch strategy.
For details, see the fetch attribute in 2.7.5 @Basic in the manual uCosminexus Application Server API Reference Guide.
optional xsd:boolean Optional Specifies whether to use null in the field (property).
For details, see the optional attribute in 2.7.5 @Basic in the manual uCosminexus Application Server API Reference Guide.

(10) <version>

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-18 Attributes of <version>

Attribute name Type Optional/Required Description
name xsd:string Required Specifies a version property or field.

(11) <many-to-one>

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-19 Attributes of <many-to-one>

Attribute name Type Optional/Required Description
name xsd:string Required Specifies methods or fields with a many-to-one relationship.
target-entity xsd:string Optional Specifies the related entity classes.
For details, see the targetEntity attribute in 2.7.29 @ManyToOne in the manual uCosminexus Application Server API Reference Guide.
fetch orm:fetch-type Optional Specifies the value of the Fetch strategy.
For details, see the fetch attribute in 2.7.29 @ManyToOne in the manual uCosminexus Application Server API Reference Guide.
optional xsd:boolean Optional Defines whether to specify null in all the non-primitive field and property values.
For details, see the optional attribute in 2.7.29 @ManyToOne in the manual uCosminexus Application Server API Reference Guide.

(12) <one-to-many>

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-20 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 Specifies the related entity classes. For details, see the mappedBy attribute in 2.7.36 @OneToMany in the manual uCosminexus Application Server API Reference Guide.
fetch orm:fetch-type Optional Specifies the value of the Fetch strategy.
For details, see the fetch attribute in 2.7.36 @OneToMany in the manual uCosminexus Application Server API Reference Guide.
mapped-by xsd:string Optional Specifies the field (property) names allocated to the elements of the owned-side entity class and the relations are maintained in the owner-side entity class.
For details, see the mappedBy attribute in 2.7.36 @OneToMany in the manual uCosminexus Application Server API Reference Guide.

(13) <one-to-one>

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-21 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.

(14) <many-to-many>

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-22 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.

(15) <embedded>

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-23 Attributes of <embedded>

Attribute name Type Optional/Required Description
name xsd:string Required Property or field that is an embedded object.

(16) <transient>

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-24 Attributes of <transient>

Attribute name Type Optional/Required Description
name xsd:string Required Property or field that is non-persistent.