Emond Papegaaij (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiNGQ4Y2VmN2Nh...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-15727?atlOrigin=eyJpIjoiNGQ4Y2...
) HHH-15727 (
https://hibernate.atlassian.net/browse/HHH-15727?atlOrigin=eyJpIjoiNGQ4Y2...
) Regression: 'replace" function on property of enum type results in type
mismatch (
https://hibernate.atlassian.net/browse/HHH-15727?atlOrigin=eyJpIjoiNGQ4Y2...
)
Issue Type: Bug Affects Versions: 6.1.5 Assignee: Unassigned Created: 16/Nov/2022 01:18 AM
Priority: Major Reporter: Emond Papegaaij (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
While working on the upgrade to WildFly 27, we ran into the issue below. The case runs
fine on Hibernate ORM 5.6.14 and 5.3.28 (on WildFly 26.1.2).
An enum property mapped with @Enumerated(EnumType.STRING) , cannot be used in the replace
function, because it expects a STRING. As the property is mapped with EnumType.STRING, I
would expect this to work (as it did in older versions of Hibernate ORM).
org.hibernate.QueryException: Parameter 1 of function replace() has type STRING, but
argument is of type org.hibernate.bugs.entities.MyEnum
at
org.hibernate.query.sqm.produce.function.ArgumentTypesValidator.throwError(ArgumentTypesValidator.java:214)
at
org.hibernate.query.sqm.produce.function.ArgumentTypesValidator.checkType(ArgumentTypesValidator.java:169)
at
org.hibernate.query.sqm.produce.function.ArgumentTypesValidator.validate(ArgumentTypesValidator.java:74)
at
org.hibernate.query.sqm.function.AbstractSqmFunctionDescriptor.generateSqmExpression(AbstractSqmFunctionDescriptor.java:104)
at
org.hibernate.query.sqm.internal.SqmCriteriaNodeBuilder.function(SqmCriteriaNodeBuilder.java:1493)
at
org.hibernate.query.sqm.internal.SqmCriteriaNodeBuilder.function(SqmCriteriaNodeBuilder.java:153)
at org.hibernate.bugs.JPAUnitTestCase.hhh15727Test(JPAUnitTestCase.java:44)
(
https://hibernate.atlassian.net/browse/HHH-15727#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-15727#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100210- sha1:9b34d7c )