nerdexam
Oracle

1Z0-860 · Question #143

A User entity is in a one-to-many relationship with a Book entity. Assume that a developer has a function fetchBook(String title) that fetches a Book entity with the given title title. Also assume…

The correct answer is D. books"). setParameter("great",fetchBook("Java")). See the full explanation below for the reasoning.

Question

A User entity is in a one-to-many relationship with a Book entity. Assume that a developer has a function fetchBook(String title) that fetches a Book entity with the given title title. Also assume that the developer has an entity manager em. Which query can be used to return the user that holds the book titled "Java"?

Options

  • Aem.createQueryfSELECT u FROM User u where :great IN
  • Bbooks.title").setParameter("great","Java")
  • Cem.createQuery("SELECT u FROM User u where :great IN
  • Dbooks"). setParameter("great",fetchBook("Java"))
  • Eem.createQuery("SELECT u FROM User u where :great MEMBER OF
  • Fbooks.title"). setParameter("great" ."Java")
  • Gem.createQuery("SELECT u FROM User u where :great MEMBER OF
  • Hbooks"). setParameter("great",fetchBook("Java"))

How the community answered

(28 responses)
  • C
    4% (1)
  • D
    79% (22)
  • E
    4% (1)
  • G
    11% (3)
  • H
    4% (1)

Community Discussion

No community discussion yet for this question.

Full 1Z0-860 Practice