-->
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.  [ 2 posts ] 
Author Message
 Post subject: collection creation problem
PostPosted: Tue Aug 24, 2004 5:51 am 
Newbie

Joined: Tue Aug 24, 2004 5:37 am
Posts: 3
Hi guys, I found the following code in the Hibernate reference manual is not working in Hibernate 2.1.6

Cat cat = new DomesticCat();
Cat kitten = new DomesticCat();
....
Set kittens = new HashSet();
kittens.add(kitten);
cat.setKittens(kittens);
session.save(cat);

I traced SQL statement, and found that hibernate create SQL update statement rather than SQL insert statement. But if you delete "cat.setKittens(kittens);" statement, the correct SQL insert statement is created. It looks like hibernate mess up the non-saved id value when the collection is set.

BTW, the above code is working fine in 2.1.5 and 2.1.4 release.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 24, 2004 6:49 am 
Newbie

Joined: Tue Aug 24, 2004 6:47 am
Posts: 3
I have the same problem with the version 2.1.6.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.