-->
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: mapping full table for one-to-many collection or standalone
PostPosted: Sun Feb 06, 2005 7:50 pm 
Beginner
Beginner

Joined: Wed Feb 04, 2004 4:54 am
Posts: 25
How can I map a full table as a one-to-many set in a given object? Briefly I have a single root object (now not persistent but I can simply add a table with only one record to simulate it's persistence) and this root has many getters that should return collections of persistent objects. I would like to map them as like as a normal one-to-many collection but I have no foreign-key because all the records in the other table should be linked to this
object.

I would not add hibernate stuff into my "singleton" root object.

I've selected 2 solutions, but I'm blocked on both:

1) make the root persistent, load it from the session and work with this object as like any other hibernate object, but: I don't know how to map a whole table as a one-to-many set for this root.

2) create a new root object (non persistent) and populate it's collection with hibernate query, but: I need this collections to be lazy. How can I obtain a persistent hibernate collection object so that I can inject this object to into my root object?

Sorry for my poor english!


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.