Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

CMP bean problem with auto generated primary key  RSS feed

 
Raj Pod
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am using Weblogic 6.0 and EJB 2.0 specification.
I am generating an CMP entity bean. The table for this entity bean has an auto-generated primary key(you may find this in MS-Access). Now how do I tell the entity bean that the primary key is automatically generated and not to be provided by the client?
I tried by not providing the primary key in the create method, but it throws an error stating that the primary key has to be set.
I have tried with BMP entity bean. It is working. But I want to do it with CMP.
Please provide an answer to this solution.
Raj
 
Volodymyr Shram
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Raj Pod:

I tried by not providing the primary key in the create method, but it throws an error stating that the primary key has to be set.

Hi, Raj!
Did you try next realisation in your CMP-bean?:

I think this have to work....
Regards, Volodymyr Shram.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!