In my case, the primary key class is known. So using an unknown-pk is not really what I wanted. I know the field I want is a Long, and I want to have an field accessor for it. So, I specified the the primkey-field to the deployment descriptor, and added removed the unknown-pk stuff.
I saw no reason why JDBCPkSqlCreateCommand should only work for Unknown Primary Keys, so I simply removed that check.
Did you find any other way to achieve this without changing the JDBCPkSqlCreateCommand.
This looks like has been fixed in JBoss 3.2.2 (RC4), all you have to is specify in jbosscmp-jdbc.xml, for the given entity
<entity-command name="get-generated-keys" class="org.jboss.ejb.plugins.cmp.jdbc.keygen.JDBCOracleCreateCommand">
USER_ID is the primary key here generated from the sequence, the ejb-jar.xml specifies for the entity
among the other usual cmp fields. This works good.