-->
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: How to set up association with unmapped class?
PostPosted: Fri Mar 16, 2007 1:32 pm 
Newbie

Joined: Fri Aug 11, 2006 2:12 pm
Posts: 2
Hi

I have a one-to-many association to a class which is not mapped to any table.This association has to refer to a loader sql-query and populate the set.
How can I accomplish that in hibernate?

Thanks & Regs
Anand


Top
 Profile  
 
 Post subject: use setter
PostPosted: Fri Mar 16, 2007 8:14 pm 
Newbie

Joined: Fri Mar 16, 2007 5:52 pm
Posts: 2
using annotations and mapping the hibernate associations to the getter/setters rather than directly to a property, i have accomplished something similar by populating the pseudo-relation set when the setter for the related property is called.

alternately, if your DB supports views, you might consider creating a view with the query that you use to populate your pseudo-relation set and mapping the relationship to the view in hibernate.


Top
 Profile  
 
 Post subject: Re: use setter
PostPosted: Mon Mar 19, 2007 10:40 am 
Newbie

Joined: Fri Aug 11, 2006 2:12 pm
Posts: 2
Thanks for your answer.I tried with mappings by defining a query for collection loading.

Hibernate tries to execute the query when we access children lazily but the problem is how to pass parameters through mappings file.I do not want to call named query and pass params explicitly.

Any idea on how to do it?

Thanks

derek wrote:
using annotations and mapping the hibernate associations to the getter/setters rather than directly to a property, i have accomplished something similar by populating the pseudo-relation set when the setter for the related property is called.

alternately, if your DB supports views, you might consider creating a view with the query that you use to populate your pseudo-relation set and mapping the relationship to the view in hibernate.


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.