Home » Search

About PersistenceContext

1-10 of 39Refresh
JPA Doc
94

javax.persistence.PersistenceContexts

javax.persistence Annotation PersistenceContexts Target: Classes Declares one or more PersistenceContext annotations. It is used to express a dependency on container-managed entity manager persistence contexts. Since: JPA 1.0 See Also: PersistenceContext PersistenceContext[] value (Required) One or
JPA Doc
90

PersistenceContexts.value

Annotation Element javax.persistence.PersistenceContexts PersistenceContext[] value (Required) One or more PersistenceContext annotations. Since: JPA 1.0
JPA Doc
85

javax.persistence.PersistenceContext

javax.persistence Annotation PersistenceContext Target: Classes and fields (including property get methods) Expresses a dependency on a container-managed EntityManager and its associated persistence context. Since: JPA 1.0 String name (Optional) The name by which the entity manager
JPA Doc
85

PersistenceContext.name

Annotation Element javax.persistence.PersistenceContext String name (Optional) The name by which the entity manager is to be accessed in the environment referencing context; not needed when dependency injection is used. Default value: "" Since: JPA 1.0
JPA Doc
85

PersistenceContext.properties

Annotation Element javax.persistence.PersistenceContext PersistenceProperty[] properties (Optional) Properties for the container or persistence provider. Vendor specific properties may be included in this set of properties. Properties that are not recognized by a vendor are ignored. Default value: {} Since: JPA 1.0
JPA Doc
85

PersistenceContext.type

Annotation Element javax.persistence.PersistenceContext PersistenceContextType type (Optional) Specifies whether a transaction-scoped persistence context or an extended persistence context is to be used. Default value: javax.persistence.PersistenceContextType.TRANSACTION Since: JPA 1.0
JPA Doc
85

PersistenceContext.unitName

Annotation Element javax.persistence.PersistenceContext String unitName (Optional) The name of the persistence unit as defined in the persistence.xml file. If the unitName element is specified, the persistence unit for the entity manager that is accessible in JNDI must have the same name. Default value: "" Since: JPA 1.0
Tutorial
81

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 ... field (because it is annotated with the @PersistenceContext annotation). Handles transactions
Tutorial
81

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 ... (because it is annotated with the @PersistenceContext annotation). Handles transactions automatically
Tutorial
81

Step 3: Define an EJB Session Bean

javax.persistence.PersistenceContext; import javax.persistence.TypedQuery; @Stateless public class GuestDao { // Injected database connection: @PersistenceContext private EntityManager ... with the @PersistenceContext annotation). Handles transactions automatically using JTA - no need