• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ejbCreate method and return value

 
Anselm Paulinus
Ranch Hand
Posts: 390
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On the ejb specification page 171, it stated that the reason why the ejbCreate() return value is null for BMP "is to allow the creation of an entity bean with bean-managed persistence by subclassing an entity bean with container-managed persistence". The question now is why is the ejbCreate() return value for CMP null?
 
Philippe Maquet
Bartender
Posts: 1872
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Anselm,
In fact, it's just the contrary: ejbCreateXXX() methods for CMP entity beans must return null in order to "allow the creation of an entity bean with bean-managed persistence by subclassing an entity bean with container-managed persistence.".
Regards,
Phil.
[ March 21, 2004: Message edited by: Philippe Maquet ]
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The question now is why is the ejbCreate() return value for CMP null?

The Container does not use the return value, but you should return null because the EJB spec tells you to do so.
It is actually BMP beans which must return the primary key.
 
Anselm Paulinus
Ranch Hand
Posts: 390
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Vish Kumar
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic