| Emmanuel Bernard In my test the issue actually shows up when there is no mapping information at all. See org.hibernate.test.annotations.override.InheritedAttributeOverridingTest. But in short, in the mapped-superclass-case we have:
@MappedSuperclass
public static class A {
private Integer id;
private String name;
@Id
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
@Entity( name = "B" )
public static class B extends A {
@Override
public String getName() {
return super.getName();
}
@Override
public void setName(String name) {
super.setName( name );
}
}
And in the extends-entity-case we have:
@Entity( name = "C" )
public static class C {
private Integer id;
private String name;
@Id
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
@Entity( name = "D" )
public static class D extends C {
@Override
public String getName() {
return super.getName();
}
@Override
public void setName(String name) {
super.setName( name );
}
}
|