Appendix D. Deployment descriptors reference – EJB 3 in Action

Appendix D. Deployment descriptors reference

In this appendix we list all the elements of EJB 3 descriptors. The appendix is designed to be a quick reference you can consult when you plan to use a descriptor in your enterprise application. Each descriptor is defined by an XML schema, and we describe the elements of the schema.

As we have explained throughout the book, you have a choice of using annotations, XML descriptors, or both, to define these elements. We have mainly used annotations throughout this book, so here we also list what annotation is overridden by the descriptor, when applicable.

This appendix has three sections. The first section (D.1) provides a reference to ejb-jar.xml, which is the descriptor for session beans and MDBs. The second section (D.2) provides a reference to persistence.xml, the descriptor that makes a module a persistence module. The third section (D.3) describes the O/R mapping metadata used by JPA.

The schemas are referenced at http://java.sun.com/xml/ns/javaee/#2.

D.1. Reference for ejb-jar.xml

ejb-jar.xml is the optional deployment descriptor that is packaged in an EJB module. ejb-jar.xml has two primary elements: enterprise-beans is used to define beans, resources, and services used by the beans, and assembly-descriptor is used to declare security roles, method permissions, declarative transaction settings, and interceptors. In this section we provide references only to the elements relevant to EJB 3, and we don’t discuss any elements in the schema that are for the sole purpose of backward compatibility with EJB 2. You can refer to the schema of ejb-jar.xml at http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd.

D.1.1. enterprise-beans

The enterprise-beans element is used to define EJBs in an EJB-JAR module. You can use session or message-driven tags to define session beans or MDBs.

session

Corresponding annotations: @javax.ejb.Stateless and @javax.ejb.Stateful

The session tag is used to define a session bean.

Element/Attribute Name

Description

ejb-name

A logical name for the session bean. This is the same as the name element of the @Stateless or @Stateful annotation.

mapped-name

A vendor-specific name for the bean.

remote

Remote interface for the EJB.

local

Local interface of the EJB.

service-endpoint

Web service endpoint interface for the EJB. Only applies to stateless beans.

ejb-class

Name of the bean class.

session-type

Type of session bean, i.e., stateless or stateful.

transaction-type

Transaction type used with the EJB, i.e., BEAN or CONTAINER.

timeout-method

Timeout method for the EJB. Applies only to stateless beans.

remove-method

Remove method for stateful EJBs.

init-method

EJB 2-style create method for EJB 3 stateful EJBs.

message-driven-bean

Corresponding annotation: @javax.ejb.MessageDriven

The message-driven-bean tag is used to define an MDB.

Element/Attribute Name

Description

ejb-name

A logical name for the MDB. This is the same as the name element of @MessageDriven annotation.

mapped-name

A vendor-specific name for the bean.

message-driven-destination

Name of the destination that MDB listens to. Primarily used for EJB 2 MDBs.

messaging-type

Messaging type supported, i.e., message listener interface supported by the MDB.

service-endpoint

Web service endpoint interface for the EJB. Only applies to stateless beans.

ejb-class

Name of the bean class.

transaction-type

Transaction type used with the EJB, i.e., Bean or Container.

activation-config-property

Configuration property for an MDB. Specified using a name-value pair using

activation-config-property-name

activation-config-property-value

Similar to the @ActivationConfigProperty annotation.

Common elements for session and message-driven beans

The following elements are commonly used with session and message-driven beans.

ejb-local-ref

Corresponding annotation: @javax.ejb.EJB

Used to specify dependencies on local EJBs.

Element/Attribute Name

Description

ejb-ref-name

The name used to bind the referenced EJB to the ENC. Same as the name element in the @EJB annotation. ejb-ref-name must be specified.

ejb-link

The name of the target enterprise bean. This optional setting is used to link an EJB reference to a target enterprise bean.

local

The EJB 3 local business interface.

ref-type

The EJB reference type, i.e., session.

injection-target

Target where the EJB reference is injected when dependency injection is used.

ejb-ref

Corresponding annotation: @javax.ejb.EJB

Used to specify remote EJB references.

Element/Attribute Name

Description

ejb-ref-name

The name used to bind the referenced EJB to the ENC. Same as the name element in the @EJB annotation. ejb-ref-name must be specified.

ejb-link

The name of the target enterprise bean. This optional setting is used to link an EJB reference to a target enterprise bean.

remote

The EJB 3 remote business interface type.

ref-type

The EJB reference type, i.e., “session”.

injection-target

Target where the EJB reference is injected when dependency injection is used.

resource-ref

Corresponding annotation: @javax.annotation.Resource

Used to specify resource references, e.g., data source, JMS connection factories, etc.

Element/Attribute Name

Description

res-ref-name

The name used to bind the referenced resource into the ENC. Same as the name element in the @Resource annotation.

mapped-name

A vendor-specific global JNDI name for the referenced resource.

res-type

Fully qualified class of the type of resource referenced, e.g., javax.sql.DataSource.

res-auth

Authentication type for the resource. Valid values are Container or Application.

res-sharing-scope

Specifies whether multiple beans can share the resource. Valid values are Shareable and Unshareable.

injection-target

Target where the referenced resource is injected when dependency injection is used.

resource-env-ref

Corresponding annotation: @javax.annotation.Resource

Used to specify resource JMS destination references, such as a Queue or Topic.

Element/Attribute Name

Description

resource-env-ref-name

The name used to bind the referenced JMS destination to the ENC. Same as the name element in the @Resource annotation.

mapped-name

A vendor-specific global JNDI name for the referenced JMS destination.

resource-env-type

Type of JMS destination referenced, such as javax.jms.Queue or javax.jms.Topic.

injection-target

Target where the referenced destination is injected when dependency injection is used.

env-entry

Corresponding annotation: @javax.annotation.Resource

Defines environment entries for an EJB.

Element/Attribute Name

Description

env-entry-name

The name used in the environment entry in the ENC. Same as the name element in the @Resource annotation.

env-entry-type

Type of the env entry used. Legal types are java.lang.Boolean, java.lang.Byte, java.lang.Character, java.lang.String, java.lang.Short, java.lang.Integer, java.lang.Long, java.lang.Float, and java.lang.Double.

env-entry-value

Value specified for the environment entry.

injection-target

Target where the referenced destination is injected when dependency injection is used.

service-ref

Corresponding annotation: @javax.xml.ws.WebServiceRef

Used to specify dependency on a web service.

The referenced schema is javaee_web_services_client_1_2.xsd, and we have discussed only elements that are useful for EJBs.

Element/Attribute Name

Description

service-ref-name

The name used to bind the referenced web service into the ENC. Same as the name element in the @WebServiceRef annotation.

service-interface

Fully qualified class for the JAX-WS service interface the client depends on, i.e., javax.xml.rpc.Service.

service-ref-type

Type of service that will be returned.

wsdl-file

The URL location of the WSDL.

handler-chains

Defines handler chain.

injection-target

Target where the web service reference is injected when dependency injection is used.

persistence-context-ref

Corresponding annotation: @javax.persistence.PersistenceContext

Defines references to a container-managed entity manager.

Element/Attribute Name

Description

persistence-context-ref-name

The name used to bind the referenced persistence context to the ENC. Same as the name element in the @PersistenceContext annotation.

persistence-unit-name

Name of the persistence unit referenced.

persistence-context-type

Type of persistence context, i.e., Transaction or Extended. Extended is supported only in stateful session beans.

persistence-property

A name value-pair of vendor-specific persistence properties.

injection-target

Target where the EntityManager is injected when dependency injection is used.

persistence-unit-ref

Corresponding annotation: @javax.persistence.PersistenceUnit

Defines references to a persistence unit (i.e., entity manager factory).

Element/Attribute Name

Description

persistence-unit-ref-name

The name used to bind the referenced persistence unit (EntityManagerFactory) to the ENC. Same as the name element in the @PersistenceUnit annotation.

persistence-unit-name

Name of the persistence unit referenced.

persistence-context-type

Type of persistence context, i.e., Transaction or Extended. Extended is supported only in stateful session beans.

persistence-property

A name value-pair of vendor-specific persistence properties.

injection-target

Target where the EntityManagerFactory is injected when dependency injection is used.

injection-target

This defines the name of a class and a name (field or property) within that class into which a resource, EJB, entity manager, etc. should be injected.

Element/Attribute Name

Description

injection-target-class

The fully qualified name of the class into which a resource, EJB, entity manager, etc. should be injected.

injection-target-name

Name of the injection target, i.e., the name of the property or field in the injection target class.

post-construct, pre-destroy, pre-passivate, post-activate

Corresponding annotations: @javax.annotation.PostConstruct, @javax.annotation.PreDestroy, @javax.ejb.PrePassivate, @javax.ejb.PostActivate

Used to define lifecycle methods.

Element/Attribute Name

Description

lifecycle-callback-class

The fully qualified name of the class in which the lifecycle callback is defined. Leave empty if the callback is in the same bean class.

lifecycle-callback-method

Name of the method defined as the lifecycle callback method.

security-role-ref

Corresponding annotation: @javax.annotation.security.DeclareRoles

Used to specify security role references.

Element/Attribute Name

Description

role-name

Name of the role referenced. The referenced role is used as a parameter in EJBContext.isCallerInRole(String roleName). See chapter 6.

role-link

A pointer to the role name defined in the module using the security-role element.

D.1.2. assembly-descriptor

You can use the assembly-descriptor element to specify declarative transactions, security role and method permissions, and interceptor binding.

security-role

Corresponding annotation: @javax.annotation.security.DeclareRoles

Used to define the security roles used in the application. This is similar to the @DeclareRoles annotation.

Element/Attribute Name

Description

role-name

Name of the security role.

method-permission

Corresponding annotation: @javax.annotation.security.RolesAllowed

Defines the security for EJB methods and signifies which roles are allowed to execute which methods.

Element/Attribute Name

Description

ejb-name

Name of the EJB. Must match the ejb-name defined for an EJB or the name element of the @Stateless and @Stateful annotations.

method

Name of the EJB method for which security is defined.

role-name

Name of the role allowed executing the method.

unchecked

Specifies that all roles be allowed to execute the method.

container-transaction

Defines the transaction settings for different EJB methods. Equivalent of the @TransactionAttribute annotation.

Element/Attribute Name

Description

ejb-name

Name of the EJB. Must match the ejb-name defined for an EJB or the name element of the @Stateless and @Stateful annotations.

method

Name of the EJB method.

trans-attribute

Specifies the Transaction attribute of the method. Valid values are Required, RequiresNew, NotSupported, Supports, Never, and Mandatory.

interceptor-binding

Defines interceptors either at the module (default interceptor), class, or method level. Similar to the @javax.interceptor.Interceptors annotation.

Element/Attribute Name

Description

ejb-name

Name of the EJB. Must match the ejb-name defined for an EJB or the name element of the @Stateless and @Stateful annotations. It can have the wildcard value *, which is used to define interceptors that are bound to all beans in the EJB-JAR.

method

Name of the EJB method.

interceptor-class

Name of the interceptor class.

exclude-default-interceptors

Specifies that default interceptors are not to be applied to a bean-class and/or business method.

exclude-class-interceptors

Specifies that default interceptors are not to be applied to a bean-class and/or business method.

exclude-list

Corresponding annotation: @javax.annotation.security.DenyAll

Lists the names of the methods customers are not allowed to execute.

Element/Attribute Name

Description

ejb-name

Name of the EJB. Must match the ejb-name defined for an EJB or the name element of the @Stateless and @Stateful annotations.

Method

Name of the EJB method being marked as uncallable.

application-exception

Corresponding annotation: @javax.ejb.ApplicationException

Defines an application exception.

Element/Attribute Name

Description

exception-class

Fully qualified name of the exception class.

Rollback

Specifies whether the container should roll back the transaction before forwarding the exception to the client.

D.2. persistence.xml reference

The persistence.xml file defines a persistence unit. It can be packaged in an EJB-JAR module, web module, or a standard JAR file. This is the only descriptor that is required by Java EE 5. There are no corresponding annotations for persistence.xml.

You can refer to the schema of persistence.xml at http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd.

persistence-unit elements

The following table describes two different elements in persistence.xml for the persistence-unit element.

Element/Attribute Name

Description

name

Name of the persistence unit. This name is used in applications to either inject or establish a reference to a persistence unit by using the @PersistenceContext and @PersistenceUnit annotations or the persistence-context-ref or persistence-unit-ref descriptor element in a client application.

transaction-type

Transaction type used for the persistence unit. Possible values are JTA or RESOURCE_LOCAL.

persistence-unit subelements

The following table describes all subelements of the persistence-unit element.

Element/Attribute Name

Description

provider

Name of the factory class of the JPA provider.

jta-data-source

JTA DataSource that points to the database that contains underlying tables for the entities configured in the persistence unit.

non-jta-data-source

Non-JTA DataSource that points to the database that contains underlying tables for the entities configured in the persistence unit. A non-jta-resource will be used when transaction-type is RESOURCE_LOCAL.

mapping-file

Name of the mapping file that contains O/R mapping info.

jar-file

Lists the additional JAR file that contains entities.

class

Identifies entity classes. Entity classes must be annotated with the @Entity annotation.

exclude-unlisted-classes

When set to true it will include entities included in the class element.

properties

A name-value pair of vendor-specific properties. Vendor-specific properties may include caching, automatic table creation directives, etc.

D.3. orm.xml (O/R mapping metadata)reference

This file defines the O/R mapping metadata for entities. It overrides any mapping metadata defined using annotations.

You can reference the XML schema for O/R mapping at http://java.sun.com/xml/ns/persistence/orm_1_0.xsd.

persistence-unit-metadata

You can use persistence-unit-metadata to specify metadata for the persistence unit. Note that it is not just for mapping a file where it is specified. It has two elements: persistence-unit-defaults and metadata-complete. When the metadata-complete element is set to true, any mappings using annotations will be ignored.

This table lists all elements in the persistence-unit-defaults element.

Element/Attribute Name

Description

schema

Database schema that contains the tables to which entities in the persistence unit are mapped.

catalog

Database catalog that contains the tables to which entities in the persistence unit are mapped.

access

Access type for all entities in the persistence unit, i.e., field or property.

cascade-persist

Specifies cascade persist for relationships for all entities.

entity-listeners

Default entity listeners for the persistence unit.

named-query

Corresponding annotation: @javax.persistence.NamedQuery

A named query element is used to define a named query using JPQL. The named query is global to the persistence unit.

Element/Attribute Name

Description

name

Name of the named query. Must be unique in the persistence unit.

query

Query in JPQL.

hint

One or more vendor-specific query hints.

named-native-query

Corresponding annotation: the @javax.persistence.NamedNativeQuery

A named native query element is used to define a named query using native SQL.

Element/Attribute Name

Description

name

Name of the named query. Must be unique in the persistence unit.

query

Query in native SQL.

hint

One or more vendor-specific query hints.

result-class

Name of the entity class returned as a result of the native query.

result-set-mapping

Name of ResultSetMapping returned by the query.

sql-result-set-mapping

Corresponding annotation: @javax.persistence.SqlResultSetMapping

A native query may return a result set mapping that is defined using multiple entity classes.

Element/Attribute Name

Description

name

Name of the sql-result-set-mapping.

entity-result

Name of the entity class.

column-result

Columns returned in the query.

sequence-generator

Corresponding annotation: @javax.persistence.SequenceGenerator

A sequence generator is used for automatic generation of numbers using a database sequence. It is defined globally and may be used with one or more entities in the persistence unit.

Element/Attribute Name

Description

name

Name of the sequence generator.

sequence-name

Name of the database sequence.

initial-value

Initial value generated when the sequence generator is used.

allocation-size

The amount the JPA provider will increase while allocating sequence numbers.

table-generator

Corresponding annotation: @javax.persistence.TableGenerator

A table generator is used for automatic generation of numbers using a sequence table. It is defined globally and may be used with one or more entities in the persistence unit.

Element/Attribute Name

Description

name

Name of the table generator.

table

Name of the sequence table.

catalog

Catalog containing the table.

schema

Schema containing the table.

pk-column-name

Name of the primary key column in the table.

value-column-name

Name of the column that stores the primary key value.

pk-column-value

Column that stores a value to distinguish table generators from one another.

initial-value

Initial value.

allocation-size

The amount the JPA provider will increase while allocating primary key values.

mapped-superclass

Corresponding annotation: @javax.persistence.MappedSuperClass. Most subelements correspond to an annotation.

The mapped-superclass element has three attributes and several subelements. The attributes class, access-type, and metadata-complete are used to specify the name of the mapped superclass, access type (i.e., field or property), and whether the XML metadata specified is complete.

Element/Attribute Name

Description

id-class

Name of the primary key class if used.

exclude-default-listeners

Set to TRUE if you want to exclude firing of the default listener for the entity.

exclude-superclass-listeners

Set to TRUE if you want to exclude firing of the superclass listener for the entity.

entity-listeners

Defines the entity listeners for the superclass.

pre-persist

Name of the prepersist method in the entity class.

post-persist

Name of the postpersist method in the entity class.

pre-remove

Name of the preremove method in the entity class.

post-remove

Name of the postremove method in the entity class.

pre-update

Name of the preupdate method in the entity class.

post-update

Name of the postupdate method in the entity class.

post-load

Name of the postload method in the entity class.

attributes

Defines the attributes/persistence fields of the mapped class.

attributes

The attributes element is used to define mapping of persistence and association fields.

There is no equivalent annotation for the attributes element; each element of attributes corresponds to an annotation.

Element/Attribute Name

Description

id-class

Designates the primary key class.

id

Designates the id field of the entity.

basic

Designates a field to be a direct-to-field mapping.

version

Defines the attribute to the version field used for optimistic locking.

many-to-one

Defines the field to be many-to-one association.

one-to-many

Defines the field to be one-to-many association.

one-to-one

Defines the field to be one-to-one association.

many-to-many

Defines the field to be many-to-many association.

embedded

Defines the attribute to be an embedded field.

transient

Designates the field to be transient.

basic

The basic element is used to define direct-to-field mapping, and the following table lists subelements of the basic element. It is equivalent to the @Basic annotation, and most elements have corresponding annotations.

Element/Attribute Name

Description

name

Name of the persistence field.

fetch

Specifies the fetch type, i.e., LAZY or EAGER.

optional

Set to true if the field is optional.

column

Name of the column.

lob

Field is LOB type.

temporal

Time or Date type.

enumerated

Enumerated type.

many-to-one

Used to map a many-to-one relationship between two entities. The following table lists elements and attributes of the basic element. It is equivalent to the @ManyToOne annotation. The join-column and join-table elements correspond to the @JoinColumn and @JoinTable annotations, respectively.

Element/Attribute Name

Description

name

Name of the association field.

target-entity

Entity class being joined.

cascade

Specifies the cascade type for the associated entities.

fetch

Specifies the fetch type, i.e., LAZY or EAGER.

optional

Specifies whether relationship is optional.

join-column

Defines join column.

join-table

Specifies the association table if any.

one-to-one

Used to map a one-to-one relationship between two entities. It is equivalent to the @OneToOne annotation. The join-column and the primary-key-join-column elements correspond to the @JoinColumn and @PrimaryKeyJoinColumn annotations, respectively.

Element/Attribute Name

Description

name

Name of the association field.

target-entity

Entity class being joined.

cascade

Specifies the cascade type for the associated entities.

fetch

Specifies the fetch type, i.e., LAZY or EAGER.

optional

Specifies whether the relationship is optional.

mapped-by

Designates the owner of the relationship.

join-column

Defines join column.

join-table

Specifies the association table if any.

primary-key-join-column

Defines join column if joined by the primary key.

one-to-many

Used to map a one-to-many relationship between two entities. It is equivalent to @OneToMany annotation. The join-column, join-table, order-by, and map-key elements correspond to the @JoinColumn, @JoinTable, @OrderBy, and @MapKey annotations, respectively.

Element/Attribute Name

Description

name

Name of the association field.

target-entity

Entity class being joined.

cascade

Specifies the cascade type for the associated entities.

fetch

Specifies the fetch type, i.e., LAZY or EAGER.

mapped-by

Designates the nonowning side of the relationship.

join-column

Defines join column.

join-table

Specifies the association table if any.

order-by

Specifies the order in which the collection of entities is retrieved.

map-key

Specifies the map key.

many-to-many

Used to map a one-to-many relationship between two entities. It is equivalent to @ManyToMany annotation. The join-column, join-table, order-by, and map-key elements correspond to the @JoinColumn, @JoinTable, @OrderBy, and @MapKey annotations, respectively.

Element/Attribute Name

Description

name

Name of the association field.

target-entity

Entity class being joined.

cascade

Specifies the cascade type for the associated entities.

fetch

Specifies the fetch type, i.e., LAZY or EAGER.

mapped-by

Designates the nonowning side of the relationship.

join-column

Defines join column.

join-table

Specifies the association table if any.

order-by

Specifies the order in which the collection of entities is retrieved.

map-key

Specifies the mapping keys for an entity association of type java.util.Map.

column

Used to define column mapping for a persistence field. It is equivalent to the @Column annotation.

Element/Attribute Name

Description

name

Name of the column.

unique

True if the column value is unique.

nullable

Designates whether the column is a nullable or mandatory column. Useful for automatic table generation.

insertable

Set to true if the column is included in the INSERT statement generated by the provider. Useful when the column is populated by triggers, default values, etc.

updatable

Set to true if the column is included in the UPDATE statement generated by the provider. Typically useful for primary keys.

column-definition

Definition of column. Useful for automatic table generation.

table

Name of the table to which the column belongs. Typically useful for an entity that is mapped to multiple tables.

length

Length of column for char/varchar2 types.

precision

Precision of numeric type columns.

scale

Scale of numeric type columns.

join-column

Used to show the relationship between two persisted entities. It is equivalent to the @JoinColumn annotation.

Element/Attribute Name

Description

name

Name of the column.

referenced-column-name

Name of the column in the referenced table.

unique

Specifies whether the join column stores unique values.

nullable

Specifies whether the relationship column is nullable or mandatory.

insertable

Set to true if the column is included in the INSERT statement generated by the provider.

updatable

Set to true if the column is included in the UPDATE statement generated by the provider.

column-definition

Definition of column. Useful for automatic table generation.

table

Name of the target table name being joined.

primary-key-join-column

Used either for a one-to-one relationship or for joining secondary tables for an entity. It is equivalent to @PrimaryKeyJoinColumn annotation.

Element/Attribute Name

Description

name

Name of the primary key column.

referenced-column-name

Name of the referenced primary key column in the join table.

column-definition

Defines primary key column. Used for table creation.

join-table

Defines the association table for a many-to-many or one-to-many relationship.

Element/Attribute Name

Description

join-column

Defines join column for the owning side of the relationship.

inverse-join-column

Defines join column for the inverse side of the relationship.

unique-constraint

Unique constraint of the join table. Used for automatic table creation.

name

Name of the join table.

catalog

Name of catalog where the table is stored.

schema

Name of the schema where the table is stored.

generator-value

Used to define the generator used with a persistence field. It is equivalent to the @GeneratedValue annotation.

Element/Attribute Name

Description

strategy

The strategy used to generate values. Valid values are AUTO, SEQUENCE, TABLE, and IDENTITY.

generator

Name of the generator used.

discriminator-column

Used to define the discriminator column used for defining entity inheritance strategies. It is equivalent to the @DiscriminatorColumn annotation.

Element/Attribute Name

Description

name

Name of the discriminator column.

discriminator-type

Type of discriminator (STRING, CHAR, INTEGER).

column-definition

Defines column. Used for automatic table creation.

length

Length of discriminator column.

embedded

Defines an embedded object defined in an entity. It is equivalent to the @Embedded annotation.

Element/Attribute Name

Description

name

Name of embedded object.

attribute-override

Specified if the entity overrides any attribute defined in the original embeddable object.

entity

Equivalent to the @Entity annotation. This is the most important element and defines a persistence object, i.e., an entity. Most subelements such as name, class, access, and metadata-complete all correspond to a specific annotation.

Element/Attribute Name

Description

name

Name of the entity. This name is used in the queries.

class

Name of the entity class.

access

Access type for the entity.

table

Name of the primary table the entity is mapped to.

secondary-table

Secondary table for the entity.

id-class

Name of the primary key class.

primary-key-join-column

Primary key join mapping for the joined entities.

inheritance

Inheritance type.

discriminator-value

Discriminator value if a subclass of entity inheritance.

discriminator-column

Discriminator column.

sequence-generator

Name of the sequence generator if values are automatically generated.

table-generator

Name of the table generator if values are automatically generated.

named-query

Named query definition for the entities.

named-native-query

Named native query definition for the entities.

sql-result-set-mapping

SQL result set mapping defined for the entity.

exclude-default-listeners

Set to TRUE if you want to exclude firing of the default listener for the entity.

exclude-superclass-listeners

Set to TRUE if you want to exclude firing of the superclass listener for the entity.

entity-listeners

Defines the callback listeners for the entity.

pre-persist

Name of the prepersist method in the entity class.

post-persist

Name of the postpersist method in the entity class.

pre-remove

Name of the preremove method in the entity class.

post-remove

Name of the postremove method in the entity class.

pre-update

Name of the preupdate method in the entity class.

post-update

Name of the postupdate method in the entity class.

post-load

Name of the postload method in the entity class.

attribute-override

Defines any column mapping being overridden from the mapped superclass or embeddable class.

association-override

Defines any association mapping being overridden from the mapped superclass or embeddable class.

attributes

Defines the mapping of persistence fields of the entity.

metadata-complete

Designates whether XML has complete metadata mapping.

embeddable

Defines an embeddable object. It is equivalent to the @Embeddable annotation.

Element/Attribute Name

Description

attributes

Defines the mapping of persistence fields of the embeddable object.

class

Name of the embeddable class.

access

Access type of embeddable class.

metadata-complete

Designates whether XML has complete metadata mapping.