-->
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: Need help on child collection
PostPosted: Mon Dec 28, 2009 10:56 am 
Newbie

Joined: Mon Dec 28, 2009 10:25 am
Posts: 1
session.saveOrUpdate(parent);

This parent row is an already existed one and it also has some children.Now the above query is updating the parent row correctly.

Next,

int size = parent.getChildren().size();

when i print the size,it always says zero.

I also tried by setting fetch="join" in the mapping file for the Parent table.
still it says the size as zero.

could anyone tell me why the child objects are not loaded here?


Top
 Profile  
 
 Post subject: Re: Need help on child collection
PostPosted: Mon Dec 28, 2009 11:53 am 
Newbie

Joined: Wed Oct 21, 2009 7:33 am
Posts: 11
Can you post your code on how you have attached the children objects to your parent object? Also, please post your mapping of your parent and child object. This will help me give you a better direction to resolve your issue.

I actually have a blog about updating the parent-child object relationship. You can check it out here http://codecrawler.blogspot.com/2009/10 ... t-iin.html


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.