Quite simply, you can't ;)

EJBs must generate their own primary keys. The only way you can do this is
have another bean that runs a custom SQL query to get a new ID from the
sequence and then use that. But this is very ugly, not DB independent and
involves coding SQL in your bean. I don't recommend it at all.

-mike

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Dan Cramer
> Sent: Sunday, February 18, 2001 5:59 PM
> To: Orion-Interest
> Subject: Oracle Sequences and CMP
>
>
> I'm trying to use CMP for beans that map to tables in which the
> primary key
> is an integer that comes from an Oracle SEQUENCE.
>
> How do I get the container to get the next number from the appropriate
> SEQUENCE on a create?
>
> Help is appreciated,
> Dan Cramer
> Chief Architect
> Dynamic Resolve, LLC
> Internet Solutions Consulting
>
>
>


Reply via email to