Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

What exactly shd be done in ejbPostCreate()method  RSS feed

 
Kunaal A Trehan
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

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

Rgds
Kunal
 
Alex Sharkoff
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
  • 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 ]
 
Malli Raman
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!