The application will need to set the bi-directional relation. One can do that
consistently within the domain class itself or outside
Inside the domain
Parent.java
public void setChildren(Set<Children> children) {
for (Child c : children) c.setParent(this);
this.children = children;
}
Or outside:
Hospital.java // a non-persistent class
void haveBabies(Parent p, Set<Children> children) {
p.setChildren(children);
for (Child c : children) c.setparent(p);
}
-----
Pinaki
--
View this message in context:
http://openjpa.208410.n2.nabble.com/Bidirectional-OneToMany-with-Enchancer-tp5091015p5098927.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.