I have created a parent class to have the fields or mappings common for all the entities in a single place.
But when the inheritance level is more than 1, hibernate throws the exception
MappingException: Repeated column in mapping for entity
The code sample is,
@MappedSuperclass
public abstract class BaseModel {
@Column(name="created_date")
private Date createdDate;
@Column(name = "modified_date")
private Date modifiedDate;
}
@MappedSuperclass
public class Order extends BaseModel {
@Column(name="due_date", nullable = true)
private Date dueDate;
}
@Entity
public class Invoice extend Order {
}
Can someone please point out anything that I am doing wrong ?