Which two solutions are correct?
A developer needs to include a set of managed classes in a persistence unit. Which two solutions are correct? (Choose two.) A. Place the class files in the orm.xml file. B. Place the class files in the root of the…
A developer needs to include a set of managed classes in a persistence unit. Which two solutions are correct? (Choose two.) A. Place the class files in the orm.xml file. B. Place the class files in the root of the…
An application creates a TypedQuery object to perform a query, and sets the query object’s flush mode by calling setFlushMode (FlushModeType.commit). The query is executed within a transaction. Which of the following is true? A. Updates to the database tables…
An application has two entities, Department and Employee, and there is a one-to-many relationship between them. The application has the following query: SELECT d FROM Department d LEFT JOIN FETCH d. employees WHERE d.name = : name After receiving the…
A developer wants to ensure that an entity’s data is up-to-date with regard to the database. Which of the following statements is guaranteed to accomplish this? A. Call EntityManager.refresh on the entity. B. Add a cacheable (false) annotation on the…
An application has three entities: the mapped superclass person class entity, and the parent and child entities, which are subclasses of person. The application has created four entity Instances: Caching has been enabled in the persistence unit, the persistence provider…
Given the following entity classes: @Entity @cacheable (true) Public class A { . . . } @Entity @cacheable (false) Public class B { . . .} @Entity Public class C { . . . } If the shared-cache-mode element of…
A user entity is retrieved in a query and stored in an instance variable user. The user entity has a single valued name property that uses the mapping defaults, and a photo property, which is lazily loaded. The application then…
Persistence application locks entity x with a LockModeType. PESSIMISTIC_READ lock type, which statement is true? A. This operation will force serialization among transactions attempting to read the entity data. B. This operation will result in a TransactionRolledbackException if the lock…
A session bean business method invokes UserTransaction.setRollbackonly and receives an IllegalStateException. Under which circumstance can this happen? A. The bean is using bean-managed transactions regardless of whether there is an active transaction. B. There is no circumstance that would cause…
A user entity is in a one-to-many relationship with a Book entity. In other words, a developer reach the collection of books that a user instance myUser has by using the path expression-"myuser -books". A developer wants to write a…