jpa/eclipselink setMaxResults() doesn't work with MySql - sql syntax error
Posted by: tante anni
Date: August 03, 2010 01:13AM

i am using mysql(connector 5.1.12 and db 5.1.47) in conjunction with eclipselink 2. nearly all went fine so far but now i tried to limit a select statements output with q.setMaxResults(x) but this yields a very strange Query:

"SELECT `Id` AS `Id`1, `column2` AS `column2`2, ... FROM table LIMIT 0, 5"

why "as `ID`1" - the error message says "syntax error near '1'"

Without the setMaxResults the syntax is right:
"SELECT `Id`, `column2`, ... FROM Table"

And with derby embedded driver both work. So it is a "EclipseLink with MySql" Problem?!
The settings in peristence.xml are nearly the same. the only differences are logging and "<property name="eclipselink.ddl-generation" value="drop-and-create-tables" />"



Edited 1 time(s). Last edit at 08/03/2010 01:13AM by tante anni.

Options: ReplyQuote


Subject
Written By
Posted
jpa/eclipselink setMaxResults() doesn't work with MySql - sql syntax error
August 03, 2010 01:13AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.