-->
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: Limiting results after using ResultTransformer
PostPosted: Mon May 23, 2005 10:48 am 
Newbie

Joined: Mon May 23, 2005 10:42 am
Posts: 1
Helo.

I'm using Hibernate 2.1.6.
I have a problem with foolowing code:

Criteria criteria = getSession().createCriteria(TemporaryReading.class);
criteria.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);

// Limit the result set
criteria.setFirstResult(firstRow);
criteria.setMaxResults(maxRows);

The problem is that Hibernate first limits the result and then eliminates duplicates.
Is there a way to do it in opposite order?

TIA

_________________
DAN


Top
 Profile  
 
 Post subject: Is there any update on this issue?
PostPosted: Thu Sep 08, 2005 2:04 pm 
Newbie

Joined: Wed Jul 20, 2005 4:17 pm
Posts: 3
I am experiencing the same problem with Hibernate 3.0. Please provide any assistance that you can thanks.


Top
 Profile  
 
 Post subject: Re: Limiting results after using ResultTransformer
PostPosted: Thu Sep 08, 2005 2:53 pm 
Expert
Expert

Joined: Mon Feb 14, 2005 12:32 pm
Posts: 609
Location: Atlanta, GA - USA
danlz wrote:
Helo.

I'm using Hibernate 2.1.6.
I have a problem with foolowing code:

Criteria criteria = getSession().createCriteria(TemporaryReading.class);
criteria.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);

// Limit the result set
criteria.setFirstResult(firstRow);
criteria.setMaxResults(maxRows);

The problem is that Hibernate first limits the result and then eliminates duplicates.
Is there a way to do it in opposite order?

TIA


I'm pretty sure there isn't since the setFirstResult()/setMaxResults() modify the query and duplicates are removed on the back-end.

_________________
Preston

Please don't forget to give credit if/when you get helpful information.


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.