Thanks for the explanation. I may have been too hasty in reusing that other issue’s tests, sorry for that. What about the new @Type annotation? Is this supposed to work:
@Id
@Column(name = "year_month_key")
@Type(YearMonthDateType.class)
private YearMonth yearMonthKey;
@Column(name = "year_month_value")
@Type(YearMonthDateType.class)
private YearMonth yearMonthValue;
and then:
entityManager.createQuery("SELECT MAX(de.yearMonthKey) FROM DemoEntity de");
entityManager.createQuery("SELECT MAX(de.yearMonthValue) FROM DemoEntity de");
? I’m trying to migrate code that in 5.6 used:
@TypeDefs({
@TypeDef(name = "yearmonth-date", typeClass = YearMonthDateType.class, defaultForType = YearMonth.class),
})
package pl.coretech.cdn.domain;
import io.hypersistence.utils.hibernate.type.basic.YearMonthDateType;
import org.hibernate.annotations.TypeDef;
import org.hibernate.annotations.TypeDefs;
import java.time.YearMonth;
When I’m trying this on @Id column I get Could not create JdbcLiteralFormatter, UserType class [io.hypersistence.utils.hibernate.type.basic.YearMonthDateType] did not implement org.hibernate.usertype.EnhancedUserType, so this may be a Hypersistence issue, but what about that @Type on regular column? I’m attaching a test case with code above in case you want to look into this: test-case-2.zip |