Apart from this, if it is the right pattern to do it this way, the question is wheter is possible in a Hibernate for a given @MappedSuperclass
set up the overriden property as a @Transient
or ignore it in any 'other way'?
Given mapped superclass:
@MappedSuperclass
public abstract class MappedSuperclassEntity {
private Integer field;
public Integer getField() {return field;}
public void setField(Integer field) {this.field = field;}
}
That is not possible. Javadoc of @AttributeOverride
:
(Required) The column that is being mapped to the persistent attribute. The mapping type will remain the same as is defined in the embeddable class or mapped superclass.
You can look at one of the three inheritance strategies for JPA here for another design.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With