Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
[b]Hibernate version3
Hey,
I saw a lot of topics on the " Parent child" problem.
But , still dont understand.
suppose Parent can have a lot of childs (one to many)
Is it ok to do:
Child c = new Child();
Parent p = new Parent();
p.getChilds().add(c);
session.save(p)
it dosnt work for me
the parent is cascade - all and inverse - true
what else do i need to do?
Parent
<set name="chi" cascade="all" inverse="true" >
<key column="QID" />
<one-to-many class="hibernate.model.Child" />
Child:
<many-to-one name="par" column="qid" class="hibernate.model.Parent"