Piotr Przybylski (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *commented* on HHH-16671 (
https://hibernate.atlassian.net/browse/HHH-16671?atlOrigin=eyJpIjoiNzY4Nm...
)
Re: Unable to query key attribute that uses AttributeConverter (
https://hibernate.atlassian.net/browse/HHH-16671?atlOrigin=eyJpIjoiNzY4Nm...
)
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 (
https://hibernate.atlassian.net/rest/api/3/attachment/content/50421 )
(
https://hibernate.atlassian.net/browse/HHH-16671#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16671#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#100225- sha1:da60ad2 )