QuerySyntaxException when sorting by a column using a JPQL reserved keyword

Description

I can not sort on entities with a column named "update" :

Person.java

I get the following error :

org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: generatedAlias0 near line 1, column 81 [select generatedAlias0 from fr.sebnuss.repro.Person as generatedAlias0 order by generatedAlias0.update asc]; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: generatedAlias0 near line 1, column 81 [select generatedAlias0 from fr.sebnuss.repro.Person as generatedAlias0 order by generatedAlias0.update asc]

I've reported the problem to the spring data team, who located the problem in hibernate, hence this issue. (https://jira.spring.io/browse/DATAREST-936)

I see 2 stacktraces :

AND

Environment

h2db, mariadb, docker

Activity

Show:
DHIRAJ KUMAR
June 17, 2018, 6:40 AM

Hii,

I am facing the same issue in hibernate version 5.2.17

Vlad Mihalcea
June 17, 2018, 7:11 AM

You can upgrade to 5.2 then.

Not every fix on 5.2 or 5.3 will be backported to 5.1.

Vlad Mihalcea
June 17, 2018, 7:13 AM

I know realized that you are talking about 5.2.17.

DHIRAJ KUMAR
June 17, 2018, 7:21 AM

It works for 5.2.9 version,

Vlad Mihalcea
June 17, 2018, 7:29 AM

Create a replicating test case and send it as a Pull Request. Thanks.

Assignee

Andrea Boriero

Reporter

S├ębastien Nussbaumer

Fix versions

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure