Version 1



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



    set @row = 0;

    select, u.facebook, u.firstName, u.lastName,,

    (SELECT row FROM (SELECT id, @row \\:= @row+1 AS row from Users ORDER BY credit desc) drv WHERE 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.facebook, u.firstName, u.lastName,,


    This query works fine without hibernate

    I'm using hibernate 4.2.2