-->
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: Retrieving persisted data
PostPosted: Thu Aug 12, 2004 5:38 am 
Newbie

Joined: Thu Aug 12, 2004 5:30 am
Posts: 2
I have 2 very simple test classes:

Person: that has an Id, Name and a List of Books
Book : that has a Id, Title and a PERSON_ID

The releastionship is that a Person can have many Books. I'm using a one-to-many relationship to map this.

I can persist the data to my database, (although an extra column is created in the Book table...)

However what I want to know is:

When I seach for a Person in the database I can retrieve a persisted object, but the associated List of Books are not returned with it.

Do I have to search the database for these book objects separately, or should they be returned by Hibernate if my initial mappings are correct.

Thanks for any help given. Please don't tell me to read the manual, I've spent weeks looking at every word of it!!!!!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 12, 2004 5:54 am 
Regular
Regular

Joined: Thu Aug 05, 2004 2:27 am
Posts: 54
Location: South Africa
Quote:
should they be returned by Hibernate if my initial mappings are correct.


yes.

post your mapping docs and I'm sure you'll get an answer consisting of more than one word.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 12, 2004 7:46 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
when you post, there is a red card, please read it....

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


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.