[jboss-dev-forums] [JBoss AS 7 Development] - MySQL := hibernate problem

Kiril Fabisevich do-not-reply at jboss.com
Mon Jun 3 04:23:30 EDT 2013


Kiril Fabisevich [https://community.jboss.org/people/kirilik] created the document:

"MySQL := hibernate problem"

To view the document, visit: https://community.jboss.org/docs/DOC-48840

--------------------------------------------------------------
Hello,

As I saw here, I added \\ to the query


set @row = 0; 
select u.id, u.facebook, u.firstName, u.lastName, u.credit, 

(SELECT row FROM (SELECT id, @row \\:= @row+1 AS row from Users ORDER BY credit desc) drv WHERE id = u.id) AS place 

from Users u 


I'm getting the below exception:


Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 'select u.id, u.facebook, u.firstName, u.lastName, u.credit,

This query works fine without hibernate
I'm using hibernate 4.2.2

Thanks,
Kiril
--------------------------------------------------------------

Comment by going to Community
[https://community.jboss.org/docs/DOC-48840]

Create a new document in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&containerType=14&container=2225]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20130603/0b46ee1d/attachment.html 


More information about the jboss-dev-forums mailing list