I used mysql field function in order by clause with Expression.stringTemplate(..) from querydsl:5.0.0. After upgrade to hibernate6, I got this erorr
Before Hibernate6, it is translated to order by field(p1_0.id,?,?,?). But, in Hibernate6 there are brackets added in translated query. I used expression like this below:
I debugged and captured values regarding order by clause in QuerySqmImple.java  After that, I got to know where the brackets come from. In MySQLSqlAstTranslator.visitTuple(..), the brackets are added.  I changed Expression to avoid arguments considered as Tuple and it works now.
But, I don’t know this is the best way. Could you check about this? |