| The entity element declares an entity bean. The declaration consists of: an optional description; optional display name; optional small icon file name; optional large icon file name; a unique name assigned to the enterprise bean in the deployment descriptor; the names of the entity beans home and remote interfaces, if any; the names of the entity beans local home and local interface, if any; the entity beans implementation class; the entity beans persistence management type; the entity beans primary key class name; an indication of the entity beans reentrancy; an optional specification of the entity beans cmp-version; an optional specification of the entity beans abstract schema name; an optional list of container-managed fields; an optional specification of the primary key field; an optional declaration of the beans environment entries; an optional declaration of the beans EJB references; an optional declaration of the beans local EJB references; an optional declaration of the security role references; an optional declaration of the security identity to be used for the execution of the beans methods; an optional declaration of the beans resource manager connection factory references; an optional declaration of the beans resource environment references; an optional set of query declarations for finder and select methods for an entity bean with cmp-version 2.x. |
| The optional abstract-schema-name element must be specified for an entity bean with container managed persistence and cmp-version 2.x. The optional primkey-field may be present in the descriptor if the entitys persistence-type is Container. The optional cmp-version element may be present in the descriptor if the entitys persistence-type is Container. If the persistence-type is Container and the cmp-version element is not specified, its value defaults to 2.x. |
| The optional home and remote elements must be specified if the entity bean cmp-version is 1.x. |
| The optional local-home and local elements must be specified if the entity bean has a local home and local interface. |
| The optional query elements must be present if the persistence-type is Container and the cmp-version is 2.x and query methods other than findByPrimaryKey have been defined for the entity bean. |
| The other elements that are optional are "optional" in the sense that they are omitted if the lists represented by them are empty. At least one cmp-field element must be present in the descriptor if |
| the entitys persistence-type is Container and the cmp-version is 1.x, and none must not be present if the entitys persistence-type is Bean. |