Which of the following statements are correct regarding a class hierarchy of Entity classes? 1. An entity class must not extend from a Non-entity superclass. 2. A non-entity class must not extend an entity class. 3. There can be only one @MappedSuperclass class in a hierarchy and it must be the root class of the hierarchy. 4. The primary key must be defined on the entity that is the root of the entity hierarchy or on a mapped superclass of the entity hierarchy. 5. The primary key must be defined exactly once in an entity hierarchy.
The correct answers are: 4, 5
How can the option 5 be correct. Can't we can have an abstract entity with the primary key and also define it in its subclass by using @AttributeOverride?