user manual
Chapter 15: Entity Beans and Table Mapping for CMP 2.0 151
Container-managed persistence and Relationships
You must deploy these interfaces as well as an implementation of your bean's
class.
Each Entity Bean must also have corresponding entries in its JAR's
deployment descriptors. The standard deployment descriptor, ejb-jar.xml
contains essentially three different types of deployment information. These
are:
1 General Bean Information: This corresponds to the <enterprise-beans>
elements found in the descriptor file and is used for all three types of beans.
This information also includes information on the bean's interfaces and
class, security information, environmental information, and even query
declarations.
2 Relationships: This corresponds to the <relationships> elements found in
the descriptor file and applies to entity beans using CMP only. This is where
container-managed relationships are spelled out.
3 Assembly Information: This corresponds to the <assembly-descriptor>
element which explains how the beans interact with the application as a
whole. Assembly information is broken down into four categories:
■
Security Roles: simple definitions of security roles used by the
application. Any security role references you defined for your beans
must also be defined here.
■
Method Permissions: each method of each bean can have certain
rules about their execution. These are set here.
■
Container-Transactions: this specifies the transaction attributes as per
the EJB 2.0 specification for each method participating in a transaction.
■
Exclude List: methods not to be called by anyone.
In addition, each Entity Bean also provides persistence information in the
Borland-specific descriptor file, ejb-borland.xml. In this descriptor file, you
specify information used by the Borland CMP engine and PM to persist
entities in a backing store. This information includes:
■
General Bean Information: Information about deployed Enterprise
JavaBeans, including interface locations.
■
Table and Column Properties: Information about database tables and
columns used by entity beans in the JAR.
■
Security Roles: Authorization information for the deployed Enterprise
JavaBeans.
All of these can be accessed from the Deployment Descriptor Editor. You
should refer to the EJB 2.0 specification for DTD information and the proper
use of the descriptor files.
A note on reentrancy
By default, entity beans are not reentrant. When a call within the same
transaction context arrives at the entity bean, it causes the exception
java.rmi.RemoteException to be thrown.










