Win a copy of Java Challengers this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

CMP bean problem with auto generated primary key

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic