WebSphere eXtreme Scale Administration Guide > Configure WebSphere eXtreme Scale > Configuring with XML files
Entity metadata descriptor XML file
The entity metadata descriptor file is an XML file that is used to define an entity schema for WebSphere eXtreme Scale. Define all of the entity metadata in the XML file, or define the entity metadata as annotations on the entity Java™ class file. The primary use is for entities that cannot use Java annotations.
Use XML configuration to create entity metadata that is based on the XML file. When used in conjunction with annotation, some of the attributes that are defined in the XML configuration override the corresponding annotations. If you can override an element, the override is explicitly in the following sections. See emd.xsd file for an example of the entity metadata descriptor XML file.
id element
The id element implies that the attribute is a key. At a minimum, at least one id element must be specified. You can specify multiple id keys for use as a compound key.
Attributes
- name
- Specifies the name of the attribute. The attribute must exist in the Java file.
- alias
- Element alias. The alias value is overridden if used in conjunction with an annotated entity.
basic element
The basic element implies that the attribute is a primitive type or wrappers to primitive types:
- java.lang.String
- java.math.BigInteger
- java.math.BigDecimal
- java.util.Date
- java.util.Calendar
- java.sql.Date
- java.sql.Time
- java.sql.Timestamp
- byte[]
- Byte[]
- char[]
- Character[]
- Java Platform, Standard Edition v5 enum
It is not necessary to specify any attribute as basic. The basic element attributes are automatically configured using reflection.
Attributes
- name
- Specifies the name of the attribute in the class.
- alias
- Element alias. The alias value is overridden if used in conjunction with an annotated entity.
- fetch
- Fetch type. Valid values include: LAZY or EAGER.
id-class element
The id_class element specifies a compound key class, which helps to find entities with compound keys.
Attributes
- class-name
- Class name, which is an id-class, to use with the id-class element.
transient element
The transient element implies that it is ignored and not processed. It also can be overridden if used in conjunction with annotated entities.
Attributes
- name
- Specifies the name of the attribute, which is ignored.
version element
Attributes
- name
- Specifies the name of the attribute, which is ignored.
cascade-type element
Child elements
- cascade-all: Cascades the all operation to associations.
- cascade-persist: Cascades the persist operation to associations.
- cascade-remove: Cascades the remove operation to associations.
- cascade-merge: Currently not used.
- cascade-refresh: Currently not used.
one-to-one element
Attributes
- name
- Specifies the name of the class, which has a one-to-one relationship.
- alias
- Specifies a name alias.
- target-entity
- Association class. This value is a fully-qualified class name.
- fetch
- Fetch type. Valid values include: LAZY or EAGER.
- mapped-by
- Field that owns the relationship. The mapped-by element is only specified on the inverse (non-owning) side of the association.
- id
- Identifies the association as key.
Child elements
- cascade: cascade-type element
one-to-many element
Attributes
- name
- Specifies the name of the attribute in the class.
- alias
- Specifies a name alias.
- target-entity
- Association class. This value is a fully-qualified class name.
- fetch
- Fetch type. Valid values include: LAZY or EAGER.
- mapped-by
- Field that owns the relationship. The mapped-by element is only specified on the inverse (non-owning) side of the association.
Child elements
- order-by
- cascade: cascade-type element
many-to-one element
Attributes
- name
- Specifies the name of the attribute in the class.
- alias
- Specifies a name alias.
- target-entity
- Class to which this attribute refers. This value is a fully-qualified class name.
- fetch
- Fetch type. Valid values include: LAZY or EAGER.
- id
- Identifies the association as a key.
Child elements
- cascade: cascade-type element
many-to-many element
Attributes
- name
- Specifies the name of the attribute in the class.
- alias
- Specifies a name alias.
- target-entity
- Class to which this attribute refers. This value is a fully-qualified class name.
- fetch
- Fetch type. Valid values include: LAZY or EAGER.
- mapped-by
- Filed that owns the relationship. The mapped-by element is only specified on the inverse (non-owning) side of the association.
Child elements
- order-by
- cascade: cascade-type element
attributes element
Child elements
- id element
- basic element
- version element
- many-to-one element
- one-to-many element
- one-to-one element
- many-to-many element
- transient element
Entity element
Attributes
- name(required)
- Specifies the name of the attribute in the class.
- class-name
- Fully-qualified class name.
- access
- Access type. The valid values are PROPERTY or FIELD.
- schemaRoot
- Specifies that this entity is the schema root and is used as a parent class for partitioned data.
Child elements
- description: Specifies a description.
- id-class element
- attributes element
entity-mappings element
Child elements
- description: Specifies a description.
- Entity element
entity-listener element
Attributes
- class-name (required)
- Specifies the name of the listener class.
Child elements
- PrePersist element
- PostPersist element
- PreRemove element
- PreUpdate element
- PostUpdate element
- PostLoad element
PrePersist element
Attributes
- method-name (required)
- Lifecycle callback method for the PrePersist event.
PostPersist element
Attributes
- method-name (required)
- Lifecycle callback method for the PostPersist event.
PreRemove element
Attributes
- method-name (required)
- Lifecycle callback method for the PreRemove event.
PreUpdate element
Attributes
- method-name (required)
- Lifecycle callback method for the PreUpdate event.
PostUpdate element
Attributes
- method-name (required)
- Lifecycle callback method for the PostUpdate event.
PostLoad element
Attributes
- method-name (required)
- Lifecycle callback method for the PostLoad event.
- emd.xsd file
Use the entity metadata XML schema definition to create a descriptor XML file and define an entity schema for WebSphere eXtreme Scale.
Parent topic
Configure with XML files