Valid 1Z0-898 Dumps shared by ExamDiscuss.com for Helping Passing 1Z0-898 Exam! ExamDiscuss.com now offer the newest 1Z0-898 exam dumps, the ExamDiscuss.com 1Z0-898 exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com 1Z0-898 dumps with Test Engine here:
Given: @PersistenceContext EntityManager em; public boolean test(Order o) { boolean b = false; o = em.merge(o); em.remove(o); o = em.merge(o); b = em.contains(o); return b; } Which statement is correct?
Correct Answer: A
Explanation/Reference: * Order An object that defines an ordering over the query results. * merge(T entity) Merge the state of the given entity into the current persistence context remove(java.lang.Object entity) * Remove the entity instance. * contains(java.lang.Object entity) Check if the instance is a managed entity instance belonging to the current persistence context. Note: An EntityManager instance is associated with a persistence context. A persistence context is a set of entity instances in which for any persistent entity identity there is a unique entity instance. Within the persistence context, the entity instances and their lifecycle are managed. The EntityManager API is used to create and remove persistent entity instances, to find entities by their primary key, and to query over entities. The set of entities that can be managed by a given EntityManager instance is defined by a persistence unit. A persistence unit defines the set of all classes that are related or grouped by the application, and which must be colocated in their mapping to a single database