About EntityManager

81-90 of 200Refresh
Tutorial
13

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
13

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
13

JPA Lifecycle Events

(added to the EntityManager). @PostPersist - after storing a new entity in the database (during commit or ... - when an entity is identified as modified by the EntityManager. @PostUpdate - after updating an entity in ... the EntityManager. @PostRemove - after deleting an entity from the database (during commit or flush). An entity
Tutorial
13

Step 3: Define an EJB Session Bean

; import java.util.List; import javax.ejb.Stateless; import javax.persistence.EntityManager; import ... class GuestDao { // Injected database connection: @PersistenceContext private EntityManager ... ). Prepares an EntityManager automatically and injects it into the em field (because it is annotated
Manual
13

Query Parameters in JPA [2011-04-01]

getCountryByName(EntityManager em, String name) { TypedQuery query = em.createQuery ... : public Country getCountryByName(EntityManager em, String name) { TypedQuery query = em ... without parameters: public Country getCountryByName(EntityManager em, String name
Manual
13

Query Parameters in JPA

getCountryByName(EntityManager em, String name) { TypedQuery query = em.createQuery ... : public Country getCountryByName(EntityManager em, String name) { TypedQuery query = em ... without parameters: public Country getCountryByName(EntityManager em, String name
Manual
11

SELECT clause (JPQL / Criteria API)

The ability to retrieve managed entity objects is a major advantage of JPQL. For example, the following query returns Country objects that become managed by the EntityManager em: TypedQuery ... are not associated with an EntityManager and changes to them when a transaction is active are not
Manual
11

Entity Management Settings

the persistence context of the EntityManager (which serves as a first level cache). The valid values are "weak ... all its EntityManager instances. The level 2 cache is disabled by specifying 0 or 0mb. The element
Manual
11

JPA Metamodel API

by the EntityManager's getMetamodel method (both methods are equivalent). For example, given an EntityManager, em, a Metamodel instance can be obtained by: Metamodel metamodel = em.getMetamodel
Result
11

ObjectDB Object Database Features [2018-01-27]

and timeout. Caching L1 entity object cache (per EntityManager). L2 shared entity data cache ... on an EntityManager/PersistenceManager. Supports automatic download of created backups from the server