• Post Reply Bookmark Topic Watch Topic
  • New Topic

Auto Generated Primary Key  RSS feed

 
John Rainey
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a database table with 3 columns:
1. id
2. name
3. text

The id - primary key - is being generated by the database as a sequential key. I'm confused about how to implement this field in my cmp entity bean. During the ejbCreate, I can't set the field since it's being generated by the database.

thanks for your help.
 
yc lim
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try setting the value as null or 0, it works for me on MySQL
 
Arun Prasath
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
which application server are you using?
I am using weblogic 6 sp3 and I am able to generate CMP on a table whose primary key is a sequence by mentioning its details in weblogic-cmp-rdbms-jar.xml

Look into your application server's documentation.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!