nerdexam
Oracle

1Z0-860 · Question #64

A User entity is in a one-to-many relationship with a Book entity. A developer writes a query to delete users that have a first name of Fred1or 'Ginger', and writes the following Java Persistence quer

The correct answer is B. The query causes a foreign key integrity constraint to be violated.. See the full explanation below for the reasoning.

Question

A User entity is in a one-to-many relationship with a Book entity. A developer writes a query to delete users that have a first name of Fred1or 'Ginger', and writes the following Java Persistence query language statement: DELETE FROM User u WHERE u.name IN (Fred', "Ginger) If the query fails with a Persistence Exception, what can be the cause?

Options

  • AThe syntax of the query is NOT correct.
  • BThe query causes a foreign key integrity constraint to be violated.
  • CThe database does NOT have any users with the name Fred' or 'Ginger'.
  • DThe entities corresponding to the users with the name Fred' or 'Ginger' are already being managed by

How the community answered

(48 responses)
  • A
    6% (3)
  • B
    77% (37)
  • C
    4% (2)
  • D
    13% (6)

Community Discussion

No community discussion yet for this question.

Full 1Z0-860 Practice