-->
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: Custom query to populate a joined property
PostPosted: Mon Jul 25, 2005 5:27 am 
Newbie

Joined: Wed May 19, 2004 3:50 am
Posts: 11
Hi,

I'm trying to map a schema with the latest Hibernate EJB3 release + JBoss 4.0.3RC1 on Oracle 9.2.

In my model, a SESSION represents a snapshot of saved data. For each EXPERIMENT there are multiple past SESSIONs representing all past snapshot s. An EXPERIMENT needs a link to its latest SESSION only.

So I want to be able to call getSession() on my Experiment object to retrieve the latest Session - the highest numbered session for that Experiment. Is there any way to map this with Hibernate (with or without annotations) - i.e. selecting the max() session number for that experiment from the SESSION table and using this to populate the Session object? Or do I need to separately query for the Session for that Experiment and forget about direct mapping?

Many thanks,


Tom.


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.