Christian Bourque writes:
> Hi !
>
> 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 !
Hmmm. The closest I've come to this is to write an MBean which
generates keys from sequences in a database. Then in ejbCreate you
connect to the MBean and get a new PK from it...
Tom
--
Tom Cook - Software Engineer
"We rarely find that people have good sense unless they agree
with us."
- Francois, Duc de la Rochefoucauld
LISAsoft Pty Ltd - www.lisa.com.au
--------------------------------------------------
38 Greenhill Rd. Level 3, 228 Pitt Street
Wayville, SA, 5034 Sydney, NSW, 2000
Phone: +61 8 8272 1555 Phone: +61 2 9283 0877
Fax: +61 8 8271 1199 Fax: +61 2 9283 0866
--------------------------------------------------
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]