Damian S (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5ba8d59...
) *updated* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiNDcxNWZjNTRj...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16949?atlOrigin=eyJpIjoiNDcxNW...
) HHH-16949 (
https://hibernate.atlassian.net/browse/HHH-16949?atlOrigin=eyJpIjoiNDcxNW...
) QueryException: Parameter 1 of function max() has type COMPARABLE (
https://hibernate.atlassian.net/browse/HHH-16949?atlOrigin=eyJpIjoiNDcxNW...
)
Change By: Damian S (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5ba8d59...
)
The code is generating a query:
{noformat}select datasourceView.id, max(datasourceView.datasourceStatus) as
DATASOURCE_STATUS_helper_column, datasourceView.id as ID_helper_column{noformat}
datasourceStatus is an enum mapped to a text column.
{noformat}@Column(name = "status")
@Enumerated(EnumType.STRING)
private DatasourceStatus datasourceStatus;{noformat}
As a result I get.
{{org.springframework.dao.InvalidDataAccessApiUsageException:
org.hibernate.QueryException: Parameter 1 of function max() has type COMPARABLE, but
argument is of type com.xxx.datasource.domain.DatasourceStatus}}
This query was working in Hibernate 6.1.7 (and 5+ versions). It seems it was introduced in
6.2.0 and it is also present it the latest available version.
Chainging the enum definitaion to expliclty implement comparable doesn’t help.
(
https://hibernate.atlassian.net/browse/HHH-16949#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16949#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#100232- sha1:33a7c72 )