An <entity> entry in the structural section defines the makeup of the entity bean. The struc-
tural information for our Quote Bean is listed in the following code snippet:
Describes a persistent quote.
There are a couple of additions here. The first is the declaration of the primary key class. Just
like the other class declarations, this is the fully qualified Java classname for the primary key
The entry for persistence type must be present and specified whether the given entity bean's
persistence is container-managed or bean-managed. We discussed the difference between these
two in the earlier section, “Who Handles the Persistence?” The two possible values of for this
entry are Container and Bean .
Because you have decided to let the container manage the persistence for the Quote bean, you
must tell the container which fields in the entity bean it is required to manage. Each of these
attributes is declared inside the container-managed persistence entry, <cmp-field> . If you
remember, each of these attributes was declared as public in the bean class so that the con-
tainer has access to it.
A concept that we have not discussed yet is reentrance . The Quote Bean is defined as non-
reentrant by specifying the false value for the <reentrant> tag. Reentrance defines whether
the entity bean can be looped back into during the same execution context. An example of
reentrance would be: A client makes a call to entity bean A, bean A then invokes a method in
bean B, and bean B tries to invoke a method in bean A and reenter it. When developing beans
deployed to enable reentrance, take this multithreading into consideration. If reentrance is
denied in the deployment descriptor, an exception will be thrown if the system tries to reenter