-->
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: about mysql limit clause
PostPosted: Wed Nov 09, 2005 4:14 am 
Newbie

Joined: Wed Nov 09, 2005 1:26 am
Posts: 2
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:3.0.5
I use MySql.
hql="from User limit 5"
and exception: unexpected token: 5
why ?
Is the hibernate version:3.0.5 doesn't sustain limit clause?
which version should i use?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 09, 2005 4:24 am 
Newbie

Joined: Mon Oct 03, 2005 8:27 am
Posts: 13
Hi...

You cannot mix sql with hql.
The keyword *limit* is specific of mysql sql dialect while you are using hql which doesn't support this token.

See here http://www.hibernate.org/hib_docs/v3/reference/en/html/queryhql.html#queryhql-expressions
and here http://www.hibernate.org/hib_docs/v3/reference/en/html/querysql.html#querysql-creating

Nico.

don't forget to credit ,-)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 09, 2005 4:46 am 
Newbie

Joined: Wed Nov 09, 2005 1:26 am
Posts: 2
thanks for you reply.

i see.
chrisz


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.