This chapter is for is the Enterprise Bean provider; that is, the person in charge of developing the
software components on the server side, and more specifically the Entity Beans.
Note
In this documentation, the term "Bean" always means "Enterprise Bean."
8.1. Introduction to Entity Beans
An Entity Bean is comprised of the following elements, which are developed by the Enterprise Bean
Provider:
The Component Interface is the client view of the bean. It contains all the "business methods" of
•
the bean.
The Home Interface contains all the methods for the bean life cycle (creation, suppression) and for
•
instance retrieval (finding one or several bean objects) used by the client application. It can also
contain methods called "home methods," supplied by the bean provider, for business logic that is
not specific to a bean instance.
The Primary Key class (for Entity Beans only) contains a subset of the bean's fields that identi-
•
fies a particular instance of an Entity Bean. This class is optional since the bean programmer can
alternatively choose a standard class (for example,
The bean implementation class implements the business methods and all the methods (described in
•
the EJB specification) allowing the bean to be managed in the container.
The deployment descriptor, containing the bean properties that can be edited at assembly or de-
•
ployment time.
Note
According to the EJB 2.0 specification, the "Component Interface and Home Interface" can be either
local or remote. Local Interfaces (Home and Component) are to be used by a client running in the
same JVM as the EJB component. Create and finder methods of a local (or remote) home interface
return local (or remote) component interfaces. An EJB component may have both remote and local
interfaces, even if normally only one type of interface is provided. If an Entity Bean is the target of a
container-managed relationship (refer to EJB 2.0 persistence), then it must have local interfaces.
These elements are described in the following sections.
An Entity Bean represents persistent data. It is an object view of an entity stored in a relational
database. The persistence of an Entity Bean can be handled in two ways:
Container-Managed Persistence: the persistence is implicitly managed by the container; no code
•
for data access is supplied by the bean provider. The bean's state will be stored in a relational
database according to a mapping description delivered within the deployment descriptor (CMP 1.1)
or according to an implicit mapping (CMP 2.0).
Developing Entity Beans
java.lang.String
Chapter 8.
)
Need help?
Do you have a question about the APPLICATION SERVER - JONAS and is the answer not in the manual?
Questions and answers