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: Data retrieval of one-to-many relationship
PostPosted: Tue Oct 27, 2009 2:44 am 
Beginner
Beginner

Joined: Thu Dec 11, 2008 2:30 am
Posts: 47
Hi all,

I have two entities which have one-to-many relationship. Lets say 'Course' and 'Student'
One Course can have many number of students. Then in Course class there is a field like

private List<Student> students = new ArrayList<Student>();

I want to know that when we get a particular Course object, is it come with relevant Students objects ?

I think it should be the way this should behave. I saved data properly with these relationship, but I want to get data back. I got back a Course object, but I couldn't find any student associate with it.

I have DAO classes and they have no any wrong.

Is there any way to do this?

regards,
Dil.


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.