On Sep 27, Christian Bourque quoth:
> I want my ejb to use an automatically generated primary key. So when i
> call create in the home interface, i dont want to pass in the primary
> key, i want the container to automatically fill this in (such as an
> auto-increment column in MS-SQL or a sequence in oracle).
>
> Is there any way to make a CMP entity EJB use a automatic value as its
> primary key, so that in the create method you dont have to pass it the
> primary key value ?
>
> If anyone has any idea I would really appreciate !
We have some CMP beans that generate their own primary keys using sequence
numbers, however they aren't acquired from an external source. What is
passed into the ejbCreate methods is simply data to be stored. It never
occured to us that we were doing anything special. The big difference,
however is that the ejbCreate method must return the primary key and since
we generate it internally in the method it's there for us to return.
IMHO, sounds like BMP is what you need to use.
C=)
--------------------------------------------------------------------------
There are no significant bugs in our released software that any significant
number of users want fixed. -Bill Gates, Focus Magazine, Oct 23, 1995
--------------------------------------------------------------------------
Caskey <caskey*technocage.com> /// TechnoCage Inc.
--------------------------------------------------------------------------
"Welcome to the slippery slope, here is your handbasket.
...say, can you work 70 hours this week?"
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]