About EntityManager

1-10 of 200Refresh
Manual
89

Obtaining a JPA Database Connection

In JPA a database connection is represented by the EntityManager interface. Therefore, in order to manipulate an ObjectDB database we need an EntityManager instance. Operations that modify database ... an EntityManager instance consists of two steps. First we need to obtain an instance
Manual
83

Database Connection using JPA

A connection to a database is represented by an EntityManager instance, which also provides ... database connection, using a separate EntityManager instance, for every HTTP request. The main role of an EntityManagerFactory instance is to support instantiation of EntityManager instances
Manual
77

Detached Entity Objects

EntityManager but still represent objects in the database. Compared to managed entity objects, detached ... the database unless modified detached objects are merged back into an EntityManager to become managed again. Detached objects are useful in situations in which an EntityManager is not available
Manual
74

Retrieving JPA Entity Objects

. Given an EntityManager em, the following code fragment demonstrates retrieval of an Employee object ... if the specified class is not an entity class. If the EntityManager already manages the specified entity ... except that if the entity object is not already managed by the EntityManager a hollow object
Tutorial
63

Step 3: Define a Spring DAO Component

; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax ... connection: @PersistenceContext private EntityManager em; // Stores a new guest ... the controller, as shown in the next step. Prepares an EntityManager automatically and injects it into the em
Tutorial
63

Step 3: Define a Spring DAO Component

.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence ... : @PersistenceContext private EntityManager em; // Stores a new guest: @Transactional ... the next step. Prepares an EntityManager automatically and injects it into the em field
Manual
63

Storing JPA Entity Objects

state is New. An explicit call to persist associates the object with an owner EntityManager em ... managed by the EntityManager) or by commit. Referenced Embedded Objects The following code stores ... to the database using flush are considered temporary and are only visible to the owner EntityManager
JPA Doc
62

javax.persistence.EntityManager

javax.persistence Interface EntityManager Interface used to interact with the persistence context. An EntityManager instance is associated with a persistence context. A persistence context is a set ... . The EntityManager API is used to create and remove persistent entity instances, to find entities by their primary
JPA Doc
56

getDelegate()

Method javax.persistence.EntityManager Object getDelegate() Return the underlying provider object for the EntityManager, if available. The result of this method is implementation specific. The unwrap method is to be preferred for new applications. Returns: underlying provider object for EntityManager Since: JPA 1.0
JPA Doc
56

unwrap(cls)

Method javax.persistence.EntityManager T unwrap(   Class cls ) Return an object of the specified type to allow access to the provider-specific API. If the provider's EntityManager implementation ... of the object to be returned. This is normally either the underlying EntityManager implementation