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 why we are using ejbPostCreate() 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 "why we are using ejbPostCreate() " Watch "why we are using ejbPostCreate() " New topic
Author

why we are using ejbPostCreate()

basanta dwibedy
Greenhorn

Joined: Feb 05, 2007
Posts: 23
Hi ,



can any body give the answer why exactly in a Entity Bean we are using ejbPostCreate() method.

what is the exact differnece between ecjCreate() method and ejbPostCreate() method.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

ejbPostCreate gives you a chance to set cmr-fields. It is not possible in ejbCreate as the entity does not exist yet.


[My Blog]
All roads lead to JavaRanch
Vinay Raj
Ranch Hand

Joined: Jun 19, 2006
Posts: 81
To elaborate further. Relationship tables require the primary key information of the parent table of the relationship. Some times primary key generation is deferred to the database(e.g. trigger based PK generation). In such cases PKs are generated on completion of the ejbCreate method invocation. Hence an ejbPostCreate method is provided to retrieve the PK and assign it to the relationship tables.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: why we are using ejbPostCreate()
 
Similar Threads
ejbPostCreate() method
Why use ejbpostcreate() after that ejbcreate()
About ejbPostCreate
relationships and ejbPostCreate()
HF Page 316 and 319