-->
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: problems with setMaxResults and MySQL
PostPosted: Wed Feb 01, 2006 5:18 pm 
Newbie

Joined: Wed Feb 01, 2006 5:09 pm
Posts: 1
Hibernate version:3.1


Code between sessionFactory.openSession() and session.close():

Criteria criteria = sesion.createCriteria(City.class);
criteria.setFirstResult(1);
criteria.setMaxResults(10);
List results = criteria.list();


Full stack trace of any exception that occurs:
17:55:06,421 WARN JDBCExceptionReporter:71 - SQL Error: 1064, SQLState: 42000
17:55:06,468 ERROR JDBCExceptionReporter:72 - Syntax error or access violation, message from server: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'limit 1 10 this_.id as id6_0_, this_.name as name6_0_, this_.idState as idState6' at line 1"


Name and version of the database you are using: mysql

The generated SQL (show_sql=true): select limit ? ? this_.id as id6_0_, this_.name as name6_0_, this_.idState as idState6_0_, this_.zipCode as zipCode6_0_ from CITY this_

I have this problem, the conector is "mysql-connector-java-3.0.14-production-bin.jar" and the version is hibernate 3.1

help please

thanks

luis


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.