geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aaron Mulder" <>
Subject Re: Question about CMP Entity Bean key generation
Date Wed, 22 Feb 2006 20:13:10 GMT
It executes the SQL separately to get the ID, and then does an insert
with that ID.  The example used PostgreSQL syntax.


On 2/22/06, David Carew <> wrote:
> I'm trying to do this in DB2 . I found an example of a deployment plan in
> Aaron Mulder's book but I don't recognize  this particular SQL dialect.
>  <key-generator> <sql-generator> <sql>select nextval('person_seq')</sql>
> <return-type>java.lang.Integer</return-type> </sql-generator>
> Will the container use the contents of <sql> in the Values clause of an
> INSERT statement like this
> e.g. insert into foo values (contents of <sql>,....)
> or will it execute the contents of <sql> as a separate statement and expect
> it to return a single value of the appropriate type ? In DB2 this would be
>  select (nextval for mysequence) from sysibm.sysdummy1
> From the example in the book I would guess the latter approach is what is
> expected but I just wanted to verify this.

View raw message