I was just wondering if there is anything special that needs to be done in handling this situation... On this table, the database auto-increments and assigns a value to the primary key field on create... Will the cmp ejb just return this value on a create call, or is there anything special that needs to be done to handle this situation properly?
- Posted by: Nic Holbrook
- Posted on: November 21 2001 10:36 EST
- Handling auto-incrementing field as primary key in cmp ejb by Frank Weberskirch on November 26 2001 17:29 EST
- Handling auto-incrementing field as primary key in cmp ejb by Rick Jones on December 07 2001 11:00 EST
Forget the combination of autocounter fields and CMP. It does not work and there has a lot written of lines been written here about the generation of primary keys for CMP beans.
We are trying to do the same thing. It seems that auto-generated primary keys are not officially supported with EJB 2.0 CMP, but several vendors do support it. You might want to check out the following:
http://www.mail-archive.com/ejbinterest at java dot sun dot com/msg19000.html