Andrea Boriero (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiMzMwZjE3ODVm...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-17041?atlOrigin=eyJpIjoiMzMwZj...
) HHH-17041 (
https://hibernate.atlassian.net/browse/HHH-17041?atlOrigin=eyJpIjoiMzMwZj...
) Embeddable and Generics throws IllegalArgumentException (
https://hibernate.atlassian.net/browse/HHH-17041?atlOrigin=eyJpIjoiMzMwZj...
)
Issue Type: Bug Affects Versions: 6.3.0.CR1 Assignee: Andrea Boriero (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) Created: 07/Aug/2023 08:50 AM Priority: Major Reporter: Andrea Boriero (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
Given the mapping
Embeddable
public static class MyEmbeddable {
@Column
private String text;
public MyEmbeddable() {
}
private MyEmbeddable( String text) {
this.text = text;
}
public String getText() {
return text;
}
public void setText( String text) {
this.text = text;
}
}
@MappedSuperclass
public static abstract class MyMappedSuperclass<C> {
@Embedded
private C embedded;
public C getEmbedded() {
return embedded;
}
public void setEmbedded(C embedded) {
this.embedded = embedded;
}
}
@Entity(name = "myentity" )
public static class MyEntity extends MyMappedSuperclass<MyEmbeddable> {
@Id
private Integer id;
public MyEntity() {
}
private MyEntity( Integer id, String text) {
this.id = id;
setEmbedded( new MyEmbeddable( text ) );
}
public Integer getId() {
return id;
}
public void setId( Integer id) {
this.id = id;
}
}
Hibernate throws
java.lang.IllegalArgumentException: Illegal attempt to locate field [text] on
Object.class
at org.hibernate.internal.util.ReflectHelper.findField(ReflectHelper.java:406)
at
org.hibernate.property.access.internal.PropertyAccessFieldImpl.<init>(PropertyAccessFieldImpl.java:34)
at
org.hibernate.property.access.internal.PropertyAccessStrategyFieldImpl.buildPropertyAccess(PropertyAccessStrategyFieldImpl.java:26)
at org.hibernate.mapping.Property.getGetter(Property.java:386)
at
org.hibernate.boot.model.internal.ClassPropertyHolder.prepareActualProperty(ClassPropertyHolder.java:368)
at
org.hibernate.boot.model.internal.ClassPropertyHolder.addPropertyToMappedSuperclass(ClassPropertyHolder.java:288)
at
org.hibernate.boot.model.internal.ClassPropertyHolder.addPropertyToPersistentClass(ClassPropertyHolder.java:274)
at
org.hibernate.boot.model.internal.ClassPropertyHolder.addProperty(ClassPropertyHolder.java:217)
at
org.hibernate.boot.model.internal.ClassPropertyHolder.addProperty(ClassPropertyHolder.java:203)
at org.hibernate.boot.model.internal.PropertyBinder.bind(PropertyBinder.java:327)
at
org.hibernate.boot.model.internal.PropertyBinder.makePropertyAndBind(PropertyBinder.java:288)
at
org.hibernate.boot.model.internal.EmbeddableBinder.createEmbeddedProperty(EmbeddableBinder.java:246)
at
org.hibernate.boot.model.internal.EmbeddableBinder.createCompositeBinder(EmbeddableBinder.java:119)
at org.hibernate.boot.model.internal.PropertyBinder.bindBasic(PropertyBinder.java:1022)
at
org.hibernate.boot.model.internal.PropertyBinder.bindProperty(PropertyBinder.java:867)
at
org.hibernate.boot.model.internal.PropertyBinder.buildProperty(PropertyBinder.java:765)
at
org.hibernate.boot.model.internal.PropertyBinder.processElementAnnotations(PropertyBinder.java:686)
at
org.hibernate.boot.model.internal.EntityBinder.processIdPropertiesIfNotAlready(EntityBinder.java:977)
at
org.hibernate.boot.model.internal.EntityBinder.handleIdentifier(EntityBinder.java:305)
at org.hibernate.boot.model.internal.EntityBinder.bindEntityClass(EntityBinder.java:231)
at
org.hibernate.boot.model.internal.AnnotationBinder.bindClass(AnnotationBinder.java:422)
(
https://hibernate.atlassian.net/browse/HHH-17041#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-17041#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#100233- sha1:2faa3a6 )