Mike Cannon-Brookes wrote :
> Is it possible to implement an entity bean with CMP, that persists in a
> table where the primary key is an identity? (eg increments automatically)
>
> All the create methods I've seen have create(int ID) or somesuch - how can
> I write create() so that the EJB container creates the new DB record and
> reads in the primary key from the DB?
As CMP and primary key genration are vendor dependant, there are many answers..
But for EJB creation, you have 2 functions:
- ejbCreate in which you have at least to validate parameters and create
primary key
- ejbPostCreate where you can insert the data witch the generated data withe
the generated key
For example in Valto Ejipt, CMB allows you to specify SQL queries for ejbCreate
and ejbPostCreate
- ejbCreate: SQL stored procedure to get the new key
- ejbPostCreate: SQL insert
St�phane
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".