-->
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.  [ 3 posts ] 
Author Message
 Post subject: relationship one-to-many ... insert sequence
PostPosted: Fri Dec 19, 2003 1:24 pm 
Newbie

Joined: Thu Dec 11, 2003 12:14 pm
Posts: 8
I have two tables, A and B. Tha table A has many Bs (one-to-many).

To insert in B, I did this:

Code:
b = new B();
...
b.setAttributes();
...
A a = session1.load(A.class, key);
a.getBs().add(b);
session2.update(a);


Well, the problem is when b is inserted in the table, hibernate doesn

_________________
[]


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 19, 2003 1:39 pm 
Expert
Expert

Joined: Tue Sep 16, 2003 4:06 pm
Posts: 318
Location: St. Petersburg, Russia
Have you read "9.2. Bidirectional one to many" ( http://www.hibernate.org/hib_docs/refer ... hild-bidir ) ?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 19, 2003 1:45 pm 
Newbie

Joined: Thu Dec 11, 2003 12:14 pm
Posts: 8
No... until now :)

I knew about this kind of the relationship, but I would like to avoid it. But I think it will be impossible to avoid it.

Thanks a lot,

Sergio

_________________
[]


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

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.