Joined: Wed Nov 10, 2004 11:25 am Posts: 11
|
Hibernate version: 2.1.6
(I've searched forum and read lots of documentation about Hibernate)
I want to use bag of classes B in class A having not null in fk in table B. In that case I use bidirectional association. In that case I have to add manualy class A to class B while adding class B to A.
code:
A.getListOfB().add(B)
B.setA(A)
and then I can save A with hibernate.
All this can be found in "Hibernate Reference" chapter: "16.1. A note about collections"
But! I have another classes that contain class A. How do I save those classes knowing nothing about what class A should do before save.
I want to open session, call saveOrUpdate or save methods (once) and close session without additional code.
Is there a nice solution?
Thanks a lot.
_________________ Vladimir
www.devitnow.com
|
|