nerdexam
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)
  • A
    13% (7)
  • B
    6% (3)
  • C
    2% (1)
  • D
    79% (41)

Community Discussion

No community discussion yet for this question.

Full 1Z0-860 Practice