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

return type ejbCreate CMP

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello I have this doubt


In the page 331 of HFEJB shows a little sample about the method ejbCreate of a CMP bean. I know that every ejbCreateXX method should return the type of its �rimary key (in this sample String). but why the return tupe is a null. I think it must be a the primary key generated???

Thanks a lot
 
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Carlos Llona:
Hello I have this doubt


In the page 331 of HFEJB shows a little sample about the method ejbCreate of a CMP bean. I know that every ejbCreateXX method should return the type of its �rimary key (in this sample String). but why the return tupe is a null. I think it must be a the primary key generated???

Thanks a lot



For a CMP entity, the bean provider specifies the primary key field (recollect that primary key field is also a managed field) and primary key class in the deployment descriptor. The container has enough information about the primary key when the bean is being created and need not have to depend on the value returned from the ejbCreate().

However for a BMP entity, it is required that each ejbCreate() method returns the primary key value.
 
Have you no shame? Have you no decency? Have you no tiny ad?
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic