Similar to https://hibernate.atlassian.net/browse/HHH-16241 , but concerns querying when type conversion is done using UserType. Given an attribute:
@Type(YearMonthUserType.class)
private YearMonth yearMonth;
and UserType:
it’s impossible to eg. SELECT max(yearMonth), because query creation fails with:
java.lang.IllegalArgumentException: org.hibernate.QueryException: Parameter 1 of function max() has type COMPARABLE, but argument is of type java.time.YearMonth
Attached test case was made as a copy of https://github.com/hibernate/hibernate-orm/blob/6.2.4/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/YearMonthConverterTest.java, but uses @Type instead of AttributeConverter. |