Hello,
I haven’t found a solution for this issue so much because I might have more to do with jpa doing this logic at compile time, but I essentially need a way to have hibernate ignore an annotation in a subclass, that way we don’t have this extra column in the database. I know we should probably introduce an interface so we don’t have to worry about the column, however since I have a large code base, it isn’t the easiest thing to do. Is there a way I could let hibernate ignore a column in a subclass, so when I pull in the items it doesn’t look for the column?
@MappedSuperclass
public class Person {
String address;
@Column( name = "address_column")
public String getAddress() {
return address;
}
private void setAddress(String address) {
this.address= address;
}
}
@Table(name = "web_user")
public class WebUser extends Person {
@Override
@Transient
public String getAddress() {
return address;
}
}