Oracle
1Z0-860 · Question #129
Consider a deep inheritance hierarchy consisting of Java Persistence entity classes, non-entities, and mapped superclasses. Which statement is correct, assuming NO mapping descriptor is present?
The correct answer is D. The primary key must either be defined in the top most entity class of the inheritance hierarchy or it can. See the full explanation below for the reasoning.
Question
Consider a deep inheritance hierarchy consisting of Java Persistence entity classes, non-entities, and mapped superclasses. Which statement is correct, assuming NO mapping descriptor is present?
Options
- AAn entity class must NOT inherit from a non-entity class.
- BAn entity class must NOT be extended by a non-entity class.
- COnly the root class in an inheritance hierarchy can be annotated wtith @MappedSuperclass.
- DThe primary key must either be defined in the top most entity class of the inheritance hierarchy or it can
How the community answered
(52 responses)- A13% (7)
- B6% (3)
- C2% (1)
- D79% (41)
Community Discussion
No community discussion yet for this question.