This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes create method in the home Interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "create method in the home Interface" Watch "create method in the home Interface" New topic
Author

create method in the home Interface

Maneesh Chauahn
Ranch Hand

Joined: Mar 06, 2006
Posts: 48
Hi All,
I have a query regarding the implementation of the home interface in the EJB. For every createXxxx() method present in the home interface , developer need to define the ejbCreateXxxxx() and ejbPostCreateXxxx() method in the bean class. As the ejbCreateXxxx() method is called by the container prior to bean created and prepares the bean for creation.

Why there is need to define the ejbPostCreateXxxx method. As per me container can perform all the business logic that will need to create a bean should be done on ejbCreateXxxx method

So can anyone please tell me what is the use of the ejbPostCreateXxxx method
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Things to do right after the creation of the bean. Sometimes to initialize values in attributes within the bean. The Home object won't have reference to it unless you provide public methods, which isn't really a nice clean design.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

Plus you create a primary key in ejbCreate() and the bean gets full beaness only in ejbPostCreate() at which point an EJB object will be associated with that bean.


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
 
 
subject: create method in the home Interface
 
Similar Threads
about ejbcreate()
Home methods
about ejbcreate()
Sessio beans
why SessionBean interface doesn't have ejbCreate defined?