What is ejbPostCreate() used for?
The usage of the ejbPostCreate() method has always been a point of confusion for many Enterprise JavaBeans (EJB) technology developers, but is very easy to explain. During initialization of an Entity Bean, the required ejbCreate() method of the bean is called and it's context is set. Finally the ejbPostCreate() method corresponding to the ejbCreate() method is called. During the call to ejbCreate() the bean knows nothing about itself or it's context. It is therefore unable to either pass a reference to itself, to another Entity bean, or even to access its own Primary key. In ejbPostCreate() the bean has access to its own remote interface and it's own Primary Key via the EntityContext and it's getEJBObject() and getPrimaryKey() methods. This is particularly useful for establishing relationships with other Entity Beans.
Better Tools Happy Engineers
-
*"The only thing constant in a Startup is Change"*
If you aren't changing fast enough then order and complacency sets in which
leads to mediocrity and you...
7 years ago
No comments:
Post a Comment