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?
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 ]
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.