Andrea Boriero (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *updated* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiNGI1MDczMGIy...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16479?atlOrigin=eyJpIjoiNGI1MD...
) HHH-16479 (
https://hibernate.atlassian.net/browse/HHH-16479?atlOrigin=eyJpIjoiNGI1MD...
) Generic enum in @MappedSuperclass fails with java.lang.IllegalArgumentException: Named
type [...] did not implement BasicType nor UserType (
https://hibernate.atlassian.net/browse/HHH-16479?atlOrigin=eyJpIjoiNGI1MD...
)
Change By: Andrea Boriero (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
given
{code:java}public interface EnumBase {
String name();
}
public enum TestEnum implements EnumBase {
FOO, BAR
}
@MappedSuperclass
public static abstract class GenericBaseEntity<T extends EnumBase> {
@Enumerated(EnumType.STRING)
protected T state;
public T getState() {
return state;
}
public void setState(T state) {
this.state = state;
}
}
@Entity
public static class TestEntity extends GenericBaseEntity<TestEnum> {
@Id
private long id;
protected TestEntity() {
}
public TestEntity(long id) {
this.id = id;
}
}
{code}
Hibernate throws
{noformat}java.lang.IllegalArgumentException: Named type [interface
org.hibernate.orm.test.annotations.enumerated.EnumeratedAndGenericsTest$EnumBase] did not
implement BasicType nor UserType{noformat}
see also
[
https://github.com/quarkusio/quarkus/issues/32664|https://github.com/quar...]
(
https://hibernate.atlassian.net/browse/HHH-16479#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16479#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#100221- sha1:d40a829 )