• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Regarding PK

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Just look into the scenario in which i have set the primary key field as auto generated. In that case my CMP representing to that table is giving me error when i try to call the create method.
The create method is called by passing the other fields in that table. So in my point of view it should insert to that table with the values supplied. Because one trigger is created to generate the PK as automatic.
The error was primarykey field not initialized.
If anyone can suggest me an idea that would be fine.
Thanks
 
sharp shooter, and author
Posts: 1913
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there...
Thanks for joining us here at the ranch, but could you just take a quick look at the naming policy and edit your profile accordingly.
Thanks!
Simon
Bartender (moderator) of "J2EE and EJB" forum
 
Ranch Hand
Posts: 1143
1
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi George,
There are several "patterns" available for handling automatically generated, surrogate, primary keys. Here is an article that discusses the issue:
http://www.flashline.com/content/mclaughlin/bm050701.jsp?sid=1011641712765-216531326-51

And the book "EJB Design Patterns" by Floyd Marinescu also discusses this issue. You can download a PDF version of that book from here:
http://www2.theserverside.com/books/EJBDesignPatterns/index.jsp

Good Luck,
Avi.
 
reply
    Bookmark Topic Watch Topic
  • New Topic