user manual
394 BES Developer’s Guide
Complete Index of EJB Properties
ejb.findByPrimar
yKeyBehavior
Enumeration
(Verify,
Load, None)
This flag indicates the desired behavior
of the findByPrimaryKey method. The
values are:
Verify: This is the standard behavior,
for findByPrimaryKey to simply verify
that the specified primary key exists in
the database.
Load: This behavior causes the bean's
state to be loaded into the container
when findByPrimaryKey is invoked, if
the finder call is running in an active
transaction. The assumption is that
found objects will typically be used, and
it is optimal to go ahead and load the
object's state at find time. This setting
is the default.
None: This behavior indicates that
findByPrimaryKey should be a no-op.
Basically, this causes the verification of
the bean to be deferred until the object
is actually used. Since it is always the
case that an object could be removed
between calling find and actually using
the object, for most programs this
optimization will not cause a change in
client logic.
ejb.checkE
xistenceBe
foreCreate
ejb.checkExisten
ceBeforeCreate
Boolean Most tables to which entity beans are
mapped have a Primary Key
Constraint. If the CMP engine attempts
to create a bean that already exists,
this constraint is violated and a
DuplicateKeyException is thrown.
Some tables, however, do not define
Primary Key Constraints. In these
cases, the checkExistanceBeforeCreate
property can be used to avoid duplicate
entities. When set to True, the CMP
engine checks the database to see if
the entity exists before attempting the
insert operation. If the entity exists then
the DuplicateKeyException is thrown.
False
Property Type Description Default










