-->
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: HQL LIMIT not working
PostPosted: Wed May 25, 2005 12:54 pm 
Regular
Regular

Joined: Wed Sep 29, 2004 11:34 am
Posts: 62
Location: Houston, TX
HQL query not executing as expected. The limiter does not work. The query works fine but the LIMIT does not. It ouputs more than the limit it was set for. The following is the query:

Code:
select pa, max(pa.AccessTime) from PersonAccess pa
where pa.EmployeeID.Id =  31
group by pa.PersonID.Id
order by 2 DESC LIMIT 1


The resultset should only be one, but it returns many more than that.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 25, 2005 1:36 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
So, um, please point to where in the Hibernate documentation (or even the ANSI SQL standard) the famous "HQL LIMIT clause" is described.


Use setMaxResults(), and read documentation.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 26, 2005 11:25 am 
Newbie

Joined: Thu Dec 02, 2004 6:27 am
Posts: 10
It did used to work in Hibernate 2.1.

I also just had to make a minor change because of it (not that I'm complaining, it's just that it's a bit non-intuitive when migrating).


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.