• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

What exactly shd be done in ejbPostCreate()method

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

What exactly should be done in ejbPostCreate()method?
Why is it used?

Rgds
Kunal
 
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kunal,

That is what the spec says:


The container invokes the matching ejbPostCreate<METHOD>(...) method on
an instance after it invokes the ejbCreate<METHOD>(...) method with the same arguments.
The instance can discover the primary key by calling getPrimaryKey() on its
entity context object.
The entity object identity is available during the ejbPostCreate<METHOD>(...)
method. The instance may, for example, obtain the component interface of the associated entity
object and pass it to another enterprise bean as a method argument.
The entity Bean Provider may use the ejbPostCreate<METHOD>(...) to set the values
of cmr-fields to complete the initialization of the entity bean instance.



At the time of ejbPostCreate(...) is called there is already an entity created and therefore, additional things that are not allowed in ejbCreate (eg, get eb instance primary key) can be performed in order to to complete the initialization of the entity bean instance

Hope it helps
[ June 18, 2004: Message edited by: Alex Sharkoff ]
 
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Kunal Verma:
Hi All,

What exactly should be done in ejbPostCreate()method?
Why is it used?

Rgds
Kunal



1. To do the initialization work after getting the EJB Object Reference.
2. To map the CMR field.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic