I just want to know if transitive relation(i don’t know if it can be called so) can be persisted in hibernate using annotations.
ie, i have 3 pojo classes namely A,B and C.
i just map C’s instance into B and B’s instance into A.
when i save A (session.save(A)), can i get B and C persisted?
For example:
a = new A();
b = new B();
c = new C();
b.setC(c);
a.setB(b)
then,
session.save(a);
if the above line execute, i just want to know whether b and c would get persisted?
i think all of you got it what i meant.
Else, i can more elaborate my problem..
Please help me..
Thanks in advance.
You can define what object to save along with your current object. In your case
For A When A is saved, save the B object along with it.
For B When B is saved, save the C object automatically along with it
For C (Nothing to save along with it)