I have two classes A & B, B extends A and A is @MappedSuperclass as it is extended by other entities as well for some common fields.
Class A
@MappedSuperclass
public class A implements Serializable {
@Column(name="TYPE_ID")
private String type;
@Column(name="FEATURE_CODE")
private String featureCode;
}
Class B
public class B extends A implements Serializable {
@Column(name="ID")
private String id;
@Column(name="GROUP")
private String group;
}
Now the problem is while I'm trying to persist class B it takes TYPE_ID and FEATURE_CODE into the INSERT query and the target database table TABLE B doesn't have the column FEATURE_CODE which results in exception.
Can anyone point me in the right direction on how to ignore the FEATURE_CODE field while persisting the child entity B? Thanks !