• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

return type ejbCreate CMP

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Being a smart alec beats the alternative. This tiny ad knows what I'm talking about:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic