Home » Search

About EntityManager

41-50 of 200Refresh
JPA Doc
50

persist(entity)

Method javax.persistence.EntityManager void persist(   Object entity ) Make an instance managed and persistent. Parameters: entity - entity instance Throws: EntityExistsException - if the entity already exists. (If the entity already exists, the EntityExistsException may be thrown when the persist
JPA Doc
50

refresh(entity)

Method javax.persistence.EntityManager void refresh(   Object entity ) Refresh the state of the instance from the database, overwriting changes made to the entity, if any. Parameters: entity - entity instance Throws: IllegalArgumentException - if the instance is not an entity or the entity is not
JPA Doc
50

refresh(entity, properties)

Method javax.persistence.EntityManager void refresh(   Object entity,   Map properties ) Refresh the state of the instance from the database, using the specified properties, and overwriting changes made to the entity, if any. If a vendor-specific property or hint is not recognized
JPA Doc
50

remove(entity)

Method javax.persistence.EntityManager void remove(   Object entity ) Remove the entity instance. Parameters: entity - entity instance Throws: IllegalArgumentException - if the instance is not an entity or is a detached entity TransactionRequiredException - if invoked on a container-managed entity
JPA Doc
50

setFlushMode(flushMode)

Method javax.persistence.EntityManager void setFlushMode(   FlushModeType flushMode ) Set the flush mode that applies to all objects contained in the persistence context. Parameters: flushMode - flush mode Since: JPA 1.0
JPA Doc
50

setProperty(propertyName, value)

Method javax.persistence.EntityManager void setProperty(   String propertyName,   Object value ) Set an entity manager property or hint. If a vendor-specific property or hint is not recognized, it is silently ignored. Parameters: propertyName - name of property or hint value - value for property or
Tutorial
49

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
49

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
49

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
Manual
42

Updating JPA Entity Objects

entity object from within an active transaction. No EntityManager's method is invoked to report