Andrea Boriero (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZjAyZmMzODQ4...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16479?atlOrigin=eyJpIjoiZjAyZm...
) HHH-16479 (
https://hibernate.atlassian.net/browse/HHH-16479?atlOrigin=eyJpIjoiZjAyZm...
) 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=eyJpIjoiZjAyZm...
)
Issue Type: Bug Affects Versions: 6.2.1 Assignee: Andrea Boriero (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) Components: hibernate-core Created: 17/Apr/2023 03:39 AM Fix Versions: 6.2.2 Priority:
Major Reporter: Andrea Boriero (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
given
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;
}
}
Hibernate throws
java.lang.IllegalArgumentException: Named type [interface
org.hibernate.orm.test.annotations.enumerated.EnumeratedAndGenericsTest$EnumBase] did not
implement BasicType nor UserType
(
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 )