Free Oracle 1Z0-860 Exam Questions (page: 14)

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"?

A. em.createQueryfSELECT u FROM User u where :great IN
u.books.title").setParameter("great", "Java")
B. em.createQuery("SELECT u FROM User u where :great IN
C. books"). setParameter("great", fetchBook("Java"))
D. em.createQuery("SELECT u FROM User u where :great MEMBER OF
E. books.title"). setParameter("great" ."Java")
F. em.createQuery("SELECT u FROM User u where :great MEMBER OF
G. books"). setParameter("great", fetchBook("Java"))
Answer(s): D
QUESTION: 36
Given:
A session bean Foo uses container-managed transactions
The container throws a javax.transaction.TransactionRolledBackException when the doStuff
method runs
Which transaction attribute can the doStuff method have for this to occur?

A. NEVER
B. MANDATORY
C. REQUIRES_NEW
D. NOT SUPPORTED
Answer(s): B
QUESTION: 37
Within a Java EE environment, which annotation can be used to inject an entity manager
factory?

A. ?Entity
B. ?Factory
C. @JTAFactory
D. @PersistenceUnit
E. ?PersistenceContext
Answer(s): D
QUESTION: 38
Given this code snippet from a JMS message-driven bean class X:
11. public XQ { System, out. print("1 "); }
12. public void onMessagefMessage m) throws Java. rmi. RemoteException
13. try {
14. TextMessage tm = (TextMessage) m;


15

Viewing page 14 of 108



Post your Comments and Discuss Oracle 1Z0-860 exam prep with other Community members:

1Z0-860 Exam Discussions & Posts