Damian S (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5ba8d59...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZjM0MzZlMjQ1...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16949?atlOrigin=eyJpIjoiZjM0Mz...
) HHH-16949 (
https://hibernate.atlassian.net/browse/HHH-16949?atlOrigin=eyJpIjoiZjM0Mz...
) QueryException: Parameter 1 of function max() has type COMPARABLE (
https://hibernate.atlassian.net/browse/HHH-16949?atlOrigin=eyJpIjoiZjM0Mz...
)
Issue Type: Bug Affects Versions: 6.2.0 Assignee: Unassigned Created: 17/Jul/2023 09:03 AM
Environment: Hibernate 6.2.0+
Priority: Major Reporter: Damian S (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5ba8d59...
)
The code is generating a query:
select datasourceView.id, max(datasourceView.datasourceStatus) as
DATASOURCE_STATUS_helper_column, datasourceView.id as ID_helper_column
datasourceStatus is an enum mapped to a text column.
@Column(name = "status")
@Enumerated(EnumType.STRING)
private DatasourceStatus datasourceStatus;
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.
(
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 )