Click the Task button.
A Department entity is in a one-to-many relationship with an Employee entity. A developer has been asked to write a Java Persistence query to update the set of employees who are in the department 'HR' by setting their department to null.
Construct a query using the Java Persistence query language to perform this task. Construct a valid Java Persistence query by dragging and dropping the syntax fragements.
Select and Place:

An enterprise bean has security permissions set up using declarative security features. Under which two conditions can a client be guaranteed to have permission to invoke a business method on the enterprise bean? (Choose two.)
A. The Application Assembler has marked the enterprise bean methodasunchecked.
B. The client's principalhas beenassigned a securityrolewithpermissionto invokethe method.
C. The Application Assembler has set the security-identity deployment descriptor to run- as.
D. TheApplicationAssemblerhas mapped all security role references using the role-link element.
A Reader entity has a one-to-many, bidirectional relationship with a Book entity. Two Reader entities are persisted, each having two Book entities associated with them. For example, readeM has booka and bookb, while reader2 has bookc and bookd. Which query returns a Collection of fewer than four elements?
A. SELECT b.reader FROM Book b
B. SELECT r FROM BookbINNER JOINb.readerr
C. SELECTrFROM Reader r INNER JOIN r.booksb
D. SELECTrfrom BookbLEFT JOIN b.readerr LEFTJOINFETCHr.books
A developer writes an enterprise application and packages it into an .ear file. The application contains two persistence units defined at the .ear level with persistence unit names FooPU and BarPU. The application also contains an ejb-jar with one stateless session bean. Which code, when added to the stateless session bean class, injects an EntityManagerFactory at runtime?
A. PersistenceUnit private EntityManagerFactory emf; B. PersistenceContext private EntityManagerFactory emf;
B. PersistenceUnit(unitName="BarPU") private EntityManagerFactory emf;
C. Resource(name="BarPU", type=EntityManagerFactory.class) private EntityManagerFactory emf;
A developer creates a stateful session bean that is used by many concurrent clients. The clients are written by other development teams and it is assumed that these clients might not remove the bean when ending their session. The number of concurrent sessions will be greater than the defined bean cache size. The developer must consider that the state of the session bean can be influenced by either passivation or timeout. Which three actions should the developer take to make the bean behave correctly in passivation and timeout situations? (Choose three.)
A. Release references to resources ina@Removeannotated method.
B. Re-establish references to resources in an @lnit annotated method.
C. Release references to resources ina@PreDestroy annotated method.
D. Release references to resources in a @PrePassivate annotated method.
E. Re-establish referencestoresources ina ©PostActivate annotatedmethod.
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
FooBean is an EJB 3.0 session bean that can make valid use of UserTransaction. Which is guaranteed to work in an EJB container for FooBean to obtain the UserTransaclion object?
A. Invoke a method on a SessionContext that returns a UserTransaction object.
B. Perform JNDI lookup with name "java:/UserTransaction" on an InitialContext.
C. Perform JNDI lookup with the name "jdbc/UserTransaction" on an InitialContext.
D. Use the @TransactionManagement annotation to inject an instance variable of type UserTransaction in a bean class.
A session bean calls the setRollbackOnly method on the EJBContext interface within a business method with an active transaction. Which two are correct? (Choose two.)
A. The transaction timeout is immediately disabled.
B. The container will ensure that the transaction will never commit.
C. The bean must have started the current transaction for this to be legal.
D. The bean must have bean-managed transaction demarcation for this to be legal.
E. Thebean must have container-managed transaction demarcation for this to be legal.
A developer wants to have bookingDate stored in table BOOKING, flightNumber in table FLIGHTBOOKING, and hotelName in table HOTELBOOKING. Which code, inserted at Line 11 of class Booking, is appropiate for this strategy?
A. ©Joined
B. @SingleTable
C. @TablePerClass
D. @lnheritance(strategy=JOINED)
E. @lnheritance(strategy=SINGLE_TABLE)
F. @lnheritance(strategy=TABLE_PER_CLASS)
A developer writes client code that runs in a Java EE container and accesses an EJB 3.0 stateful session bean. Which three statements are correct? (Choose three.)
A. The client can obtain a reference to the bean's business interface through JNDI lookups.
B. The client can obtain a reference to the bean's business interface through dependency injection.
C. If the client calls a business method after the bean instance has been removed an exception will occur.
D. After obtaining a reference to the bean's business interface, the client must call the create method before it may call business methods.
E. After the bean instance has been passivated, the client needs to re-obtain a reference to the bean's business interface to activate the bean instance.