• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

return type ejbCreate CMP

 
Carlos Llona
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
 
Keerthi P
Ranch Hand
Posts: 203
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic