You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In HQL queries, if I use 'io.quarkus.panache.common.Sort' with a query that has an alias then the application throws org.hibernate.query.SemanticException.
Person.find("select distinct p from Person p left join p.roles r", Sort.by("p.name")).list()
The code block creates this following HQL.
select distinct p from Person p left join p.roles r ORDER BY 'p.name'
In 'io.quarkus.panache.hibernate.common.runtime.PanacheJpaUtil.toOrderBy' method causes this exception. In the method, fields are enquoted and HQL couldn't be interpreted.
Expected behavior
Hql queries that have aliases should be used with sort aliases
Actual behavior
The application throws the following error. java.lang.IllegalArgumentException: org.hibernate.query.SemanticException: Could not interpret path expression 'p.name' at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:143) at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:167) at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:173) at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:848) at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:753) at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:136) at io.quarkus.hibernate.orm.runtime.session.TransactionScopedSession.createQuery(TransactionScopedSession.java:367)
How to Reproduce?
Person.find("select distinct p from Person p left join p.roles r", Sort.by("p.name")).list()
Output of uname -a or ver
No response
Output of java -version
17
Quarkus version or git rev
3.7.1
Build tool (ie. output of mvnw --version or gradlew --version)
No response
Additional information
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
In HQL queries, if I use 'io.quarkus.panache.common.Sort' with a query that has an alias then the application throws org.hibernate.query.SemanticException.
Person.find("select distinct p from Person p left join p.roles r", Sort.by("p.name")).list()
The code block creates this following HQL.
select distinct p from Person p left join p.roles r ORDER BY 'p.name'
In 'io.quarkus.panache.hibernate.common.runtime.PanacheJpaUtil.toOrderBy' method causes this exception. In the method, fields are enquoted and HQL couldn't be interpreted.
Expected behavior
Hql queries that have aliases should be used with sort aliases
Actual behavior
The application throws the following error.
java.lang.IllegalArgumentException: org.hibernate.query.SemanticException: Could not interpret path expression 'p.name' at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:143) at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:167) at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:173) at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:848) at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:753) at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:136) at io.quarkus.hibernate.orm.runtime.session.TransactionScopedSession.createQuery(TransactionScopedSession.java:367)
How to Reproduce?
Person.find("select distinct p from Person p left join p.roles r", Sort.by("p.name")).list()
Output of
uname -a
orver
No response
Output of
java -version
17
Quarkus version or git rev
3.7.1
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
No response
The text was updated successfully, but these errors were encountered: