| Author |
container managed relationship?
|
pradeep arum
Ranch Hand
Joined: Oct 01, 2003
Posts: 130
|
|
If I have 2 tables that represent 2 beans and and they are in 1:N relationship, i do not have to mention the relation field in the ejbCreate(),but how is the mapping done to the database ,can anybody please explain? for more reference please go through this I am stuck with this part of CMRelationship... what I understand from page 396, HFEJB is-> in the ejbcreate()I have 5 fields of which 4 are inserted into the database and for the 5th one I wait till ejbPostCreate() and do a setDirector(dir)....by doing so what did the database get as the 5th field( ie how did the directorID get into the database ?) HOW IS THE FOREIGN KEY PROCESSING DONE? THROW SOME LIGHT ...PLEASE thanks Pradeep
|
SCJP1.4,SCBCD
Failure is not when you fall down; its only when you fail to get up again.
|
 |
Harsha Huddar
Greenhorn
Joined: Oct 03, 2003
Posts: 23
|
|
|
You have to mention the relationship in the ejb-jar.xml the configuration file for your EJB's
|
 |
Sergiu Truta
Ranch Hand
Joined: Dec 16, 2003
Posts: 121
|
|
You have to set all the fields inside ejbCreate(), except for the CMR field. This is the field defining the relationship and the field specified inside the deployment descriptor as the CMR field. You have to create first the bean and only then set the relationship, that is why the CMR fields are set inside ejbPostCreate().
|
...watch me...as I'm walking the path...
|
 |
 |
|
|
subject: container managed relationship?
|
|
|