nerdexam
Oracle

1Z0-860 · Question #201

The Java Persistence API defines the semantics of the remove operation and the entity lifecycle states. Which statement is true when the remove method is invoked on an entity X?

The correct answer is D. If X is a detached entity an Hlegal Argument Exception will be thrown. See the full explanation below for the reasoning.

Question

The Java Persistence API defines the semantics of the remove operation and the entity lifecycle states. Which statement is true when the remove method is invoked on an entity X?

Options

  • AIf X is a removed entity it becomes managed.
  • BIf X is a new entity it will be removed from the database.
  • CThe remove method is always cascaded to related entities.
  • DIf X is a detached entity an Hlegal Argument Exception will be thrown.

How the community answered

(29 responses)
  • A
    10% (3)
  • B
    14% (4)
  • C
    3% (1)
  • D
    72% (21)

Community Discussion

No community discussion yet for this question.

Full 1Z0-860 Practice