java.lang.NoSuchMethodError: 'org.hibernate.orm.test.bytecode.enhance.internal.bytebuddy.DirtyCheckingWithEmbeddableAndTwiceRemovedNonVisibleGenericMappedSuperclassTest$MyAbstractEmbeddable org.hibernate.orm.test.bytecode.enhance.internal.bytebuddy.DirtyCheckingWithEmbeddableAndTwiceRemovedNonVisibleGenericMappedSuperclassTest$MyMappedSuperclass.$$_hibernate_read_embedded()'
at org.hibernate.orm.test.bytecode.enhance.internal.bytebuddy.DirtyCheckingWithEmbeddableAndTwiceRemovedNonVisibleGenericMappedSuperclassTest$MyEntity.$$_hibernate_write_embedded(DirtyCheckingWithEmbeddableAndTwiceRemovedNonVisibleGenericMappedSuperclassTest.java)
at org.hibernate.orm.test.bytecode.enhance.internal.bytebuddy.MyNonVisibleGenericMappedSuperclass.setEmbedded(MyNonVisibleGenericMappedSuperclass.java:25)
at org.hibernate.orm.test.bytecode.enhance.internal.bytebuddy.DirtyCheckingWithEmbeddableAndTwiceRemovedNonVisibleGenericMappedSuperclassTest$MyEntity.<init>(DirtyCheckingWithEmbeddableAndTwiceRemovedNonVisibleGenericMappedSuperclassTest.java:195)
The model:
@MappedSuperclass
public abstract class MyAbstractEmbeddable {
}
@Embeddable
public class MyEmbeddable extends MyAbstractEmbeddable {
@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 abstract class MyMappedSuperclass<C extends MyAbstractEmbeddable>
extends MyNonVisibleGenericMappedSuperclass<C> {
}
@Entity(name = "myentity")
public 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;
}
}
// This class must not be nested in the test class, otherwise its private fields will be visible
// from subclasses and we won't reproduce the bug.
@MappedSuperclass
public abstract class MyNonVisibleGenericMappedSuperclass<C> {
@Embedded
private C embedded;
public C getEmbedded() {
return embedded;
}
public void setEmbedded(C embedded) {
this.embedded = embedded;
}
}