what can be the cause?

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 ‘Fred’ or ‘Ginger’, and writes
the following Java Persistence query language statement:
DELETE FROM User u WHERE u.name IN (‘Fred1, ‘Ginger’)
If the query fails with a PersistenceException, what can be the cause?

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 ‘Fred’ or ‘Ginger’, and writes
the following Java Persistence query language statement:
DELETE FROM User u WHERE u.name IN (‘Fred1, ‘Ginger’)
If the query fails with a PersistenceException, what can be the cause?

A.
The syntax of the query is NOT correct.

B.
The query causes a foreign key integrity constraint to be violated.

C.
The database does NOT have any users with the name ‘Fred’ or ‘Ginger’.

D.
The entities corresponding to the users with the name ‘Fred’ or ‘Ginger’ are already being
managed by the persistence context.

Explanation:



Leave a Reply 0

Your email address will not be published. Required fields are marked *