-->
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: loading objects with one-many relationship
PostPosted: Thu Dec 02, 2004 9:59 am 
Beginner
Beginner

Joined: Thu Dec 02, 2004 4:49 am
Posts: 32
Can someone post very small example on how to load the objects with one-many relationship?

Following is what I want to see...

I have an object called Person. It has personId(want to set as primary key) and another propery called name.

then I have another object called Address...a person can have many Addresses..so one-many relation between person and address...

then when i load person object it should get the corresponding addresses also(when i call person.getAddresses())

very simple it sounds...but not working for me...

it is working if i set lazy="false" but if i set lazy="true" i am getting "session closed" excpetion....

can someone plz help??

Thanks,
SSSS


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 02, 2004 10:44 am 
Expert
Expert

Joined: Tue Oct 05, 2004 9:45 am
Posts: 263
sorry for saying that, i know that i'm not a mod or admin in this forum ...

but do you think 2 threads will be better than 1? Your problems sounds pretty equal ...

Nevertheless ...

A good point to look at is the caveatemptor-example-app and the reference-doc ... or HiA ...

if 'you' don't call session.close() during your workflow, your session-handling is broken ... start with easier examples (loading, saving simple Objects) and then go step by step through the documentation ... not fast, but after that you will know what to do ... (and a lot more)

gtx
curio


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.