• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

create method in the home Interface

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic