-->
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: Spring, hibernate, pagination and Distinct
PostPosted: Sun Jun 08, 2008 8:39 am 
Pro
Pro

Joined: Wed Nov 05, 2003 7:22 pm
Posts: 211
Hi all,

It would seem that it is not possible to use Select Distinct with the Criteria API. Spring offers in its HibernateTemplate support no direct use of Query. You have to use the Criteria api to implement pagination.

ResultTransformer is no joy because it distincts a list after sql, making it useless for pagination.

Now, I saw some solutions projecting results into resultsets. This just seems to me like throwing expensive computing power at something that should just be a trivial programmatic solution. Something like Restrictions.distinct("column name")

After running into this and looking for a solution, I saw that this issue has been around for years and years and is a continuous source of complaints. At the risk of sounding arrogant, I'm just wondering: why? Is there a reason or limitation why this is not being made possible?

Cheers,

Marc


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.