This content has been marked as final.
Show 1 reply
-
1. Re: Oracle sequences and PKs
aloubyansky Oct 2, 2002 2:41 PM (in response to mlapolla)It's possible using unknow primary key.
In ejb-jar.xml prim-key-class must be java.lang.Object and no primkey-field.
ejbCreate method must return java.lang.Object and findByPrimaryKey must take the parameter of type java.lang.Object.
In jbosscmp-jdbc.xml you should place something like this:
<!-- pk-sql generated unknown-pk; overriding default sql -->
...
<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 is supported in Branch_3_2.