-->
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: one-to-many + obtaining data
PostPosted: Mon Feb 15, 2010 4:52 pm 
Newbie

Joined: Mon Feb 08, 2010 10:40 am
Posts: 4
Hi!

I have one question about one-to-many relations and a selection from table.
I´m traying to obtain some data from a table with one-to-many relation, but I observe and when i do the hibernate select, the list is not with all the values from the table.
Some values are in my list with values, and for these case, i looked that the elements haven´t relations with other table, but if any element have a relation, the values of my objet are empty.
can someone explain me what is the problem¿?

tanks in advance!

Richard.


Top
 Profile  
 
 Post subject: Re: one-to-many + obtaining data
PostPosted: Fri Feb 19, 2010 10:19 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Are the associations lazy by any chance? If you call a getter during an open session does the data get loaded? That's sorta how Hibernate works.

Take a read of this little tutorial on "How Hibernate Works."

http://www.hiberbook.com/HiberBookWeb/l ... rnateworks

Enjoy!

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
 Post subject: Re: one-to-many + obtaining data
PostPosted: Fri Feb 26, 2010 11:56 am 
Newbie

Joined: Mon Feb 08, 2010 10:40 am
Posts: 4
tanks!!!
I will take a look!!


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.