-->
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: hibernate filter on collection for max date
PostPosted: Fri Feb 17, 2006 5:50 pm 
Newbie

Joined: Fri Feb 17, 2006 5:45 pm
Posts: 6
Hello,
I want to create a hibernate filter on collection which would filter the collection and only keep the one with last date. I was wondering how I can use the max function here in hibernate filter.
Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 19, 2006 10:21 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
I think that you'd have to fetch the max date in a subquery. It would probably be easier to use order by(date, desc) wtih setMaxResults(1). You'd have to use setMaxResults even if you figure out the correct filter, because it might return more than one result.


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.