-
1. Re: CMP and Obtaining nextval from an Oracle Sequence
aloubyansky Oct 1, 2002 2:13 AM (in response to mmazur)You can do it using unknown primary key. That is a key of type java.lang.Object.
The declaration of entity in jbosscmp-jdbc.xml should look like this:
<ejb-name>MyBean</ejb-name>
<!--
| specify unknown primary key and sql to fetch next
| value
-->
<unknown-pk>
<unknown-pk-class>java.lang.Integer</unknown-pk-class>
<column-name>genid</column-name>
<jdbc-type>INTEGER</jdbc-type>
<sql-type>INTEGER</sql-type>
</unknown-pk>
<entity-command name="pk-sql">
SELECT SEQ_2279_1.nextval FROM DUAL
</entity-command>
This will work only in Branch_3_2 and HEAD. -
2. Re: CMP and Obtaining nextval from an Oracle Sequence
mmazur Oct 1, 2002 12:35 PM (in response to mmazur)thank you.
next question . . .
the container will get the nexval, how do I retrive the value in my ejbCreate method of the bean class???? where is this value sitting after the container retrieves it????? -
3. Re: CMP and Obtaining nextval from an Oracle Sequence
mmazur Oct 1, 2002 12:40 PM (in response to mmazur)where is this nextval sitting after the container retrives it???? how do i access it in my ejbCreate method of my bean class?????
thanx again