-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: No special code between sessOpen and sess.close in bidirecti
PostPosted: Wed Nov 10, 2004 1:10 pm 
Newbie

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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.