File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JBoss/WildFly and the fly likes AutoIncrement primaryKey Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "AutoIncrement primaryKey" Watch "AutoIncrement primaryKey" New topic

AutoIncrement primaryKey

Mukti Furtado

Joined: Oct 17, 2003
Posts: 9

I want to automatically increment the primary key field in the database(MySql) in a CMP bean. I have written the following lines in the jbosscmp-jdbc.xml
<entity-command name="mysql-get-generated-keys"/>
But when i get a Nullpointer exception when i try to insert a record through my CMP.
Can you please tell me where i am going wrong
Yuan Ye
Ranch Hand

Joined: Mar 05, 2003
Posts: 172
looks like you need the class name and method to be defined for the entity-command. You can refer to the following link.
I agree. Here's the link:
subject: AutoIncrement primaryKey
jQuery in Action, 3rd edition