About Persistence Context

1-10 of 200Refresh
Tutorial
174

Step 3: Add a Context Listener Class

guest; import javax.persistence.*; import javax.servlet.*; public class GuestListener ... .*"); EntityManagerFactory emf = Persistence.createEntityManagerFactory("$objectdb/db ... context - when the web application starts (contextInitialized). Retrieves the EntityManagerFactory
Tutorial
174

Step 3: Add a Context Listener Class

of the new source file with the following code: package guest; import javax.persistence.*; import ... = Persistence.createEntityManagerFactory("$objectdb/db/guest.odb"); e.getServletContext ... it as an application scope attribute in the servlet context - when the web application starts
Manual
36

Working with JPA Entity Objects [2011-04-18]

. The Persistence Context The persistence context is the collection of all the managed objects of an EntityManager. If an entity object that has to be retrieved already exists in the persistence context ... object within the same EntityManager. Every EntityManager manages its own persistence context
Manual
36

Working with JPA Entity Objects

. The Persistence Context The persistence context is the collection of all the managed objects of an EntityManager. If an entity object that has to be retrieved already exists in the persistence context ... object within the same EntityManager. Every EntityManager manages its own persistence context
JPA Doc
35

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 ... . Within the persistence context, the entity instances and their lifecycle are managed
Manual
33

JPA Persistence Unit

A JPA Persistence Unit is a logical grouping of user defined persistable classes (entity classes, embeddable classes and mapped superclasses) with related settings. Defining a persistence unit is optional when using ObjectDB, but required by JPA. persistence.xml Persistence units are defined in
Tutorial
32

Step 2: Entity Class and Persistence Unit

) and selecting New > Entity Class... (or New > Other... > Persistence > Entity Class and clicking ... the [Provider and Database] step just click Finish to generate a default persistence.xml file with a default persistence unit (that will be configured later). If the Finish button is disabled
Tutorial
32

Step 2: Entity Class and Persistence Unit

) and selecting New > Entity Class... (or New > Other... > Persistence > Entity Class and clicking ... the [Provider and Database] step click Finish to generate a default persistence.xml file with a default persistence unit (that will be configured later). If the Finish button is disabled
Tutorial
31

Step 2: Entity Class and Persistence Unit

.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; @Entity ... ; // Persistent Fields: @Id @GeneratedValue Long id; private String name ... guests in the database. We also need to configure JPA by setting a META-INF/persistence.xml file
Manual
31

JPA Persistable Types

The term persistable types refers to data types that can be used in storing data in the database. ObjectDB supports all the JPA persistable types, which are: User defined classes - Entity classes ... can be stored in the database directly. Other persistable types can be embedded in entity classes as fields. In