I'm migrating several code bases to use Hibernate 5.4.x instead of Hibernate 5.2.x.
For an abstract base class I use
@MappedSuperclass
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public abstract class AbstractPersistentJPAObject extends AbstractPersistentObject {
// some properties
}
However, the ORM complains about this with the error message
An entity cannot be annotated with both
@Inheritance
and@MappedSuperclass
This was not a problem with Hibernate <= 5.2.x and now I wonder why this should not be allowed any more.
Questions
- Is this a bug or a feature? If a feature: What the rationale behind this change?
- What can be done to circumvent the situation?
- If "circumvent" is not a valid idea: How should the above code fragment be changed to migrate it towards Hibernate >= 5.4.x correctly.
Any solid answers welcome.