This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
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 Building Microservices this week in the Design 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.
Have you checked out Aspose?
subject: AutoIncrement primaryKey
It's not a secret anymore!