Why do we write ejbPostCreate after every ejbCreate ?
Thanx Sabyasachi
-
Why ejbPostCreate () ??? (3 messages)
- Posted by: Sabyasachi Chowdhury
- Posted on: October 08 2002 10:16 EDT
Threaded Messages (3)
- Why ejbPostCreate () ??? by Andrew Perepelytsya on October 09 2002 07:41 EDT
- Why ejbPostCreate () ??? by Stephen Davies on October 12 2002 19:34 EDT
- Why ejbPostCreate () ??? by Amit Gupta on October 23 2002 12:30 EDT
-
Why ejbPostCreate () ???[ Go to top ]
- Posted by: Andrew Perepelytsya
- Posted on: October 09 2002 07:41 EDT
- in response to Sabyasachi Chowdhury
in ejbPostCreate(...) you set up all the Container Managed Relationship(CMR) fields. That's because behind the scenes CMR is implemented using foreign keys (and associative tables) in a database, and you cannot setup a relation without having the primary key of your original bean. Yes, you got, it's created in ejbCreate(...)
cheers -
Why ejbPostCreate () ???[ Go to top ]
- Posted by: Stephen Davies
- Posted on: October 12 2002 19:34 EDT
- in response to Sabyasachi Chowdhury
The EJBObject (remote object wrapper) is not created until ejbCreate has succeeded. The EJBObject is available in ejbPostCreate and is required in EJB 2.0 to set up bean relationships. -
Why ejbPostCreate () ???[ Go to top ]
- Posted by: Amit Gupta
- Posted on: October 23 2002 12:30 EDT
- in response to Stephen Davies
You can have the EntityContext(means getEjbObject()and getPrimaryKey()),only after the completion of ejbCreate().After ejbCreate(),ejbPostCreate() called and uses entitityContext to intilalize the fields as the Busssiness model,though it is must to intialize them .It depends only on your AppliactionModel.
Cheers