ObjectDB ObjectDB

Internal Website Search

41-50 of 200 resultsRefresh


Method javax.persistence.EntityManager FlushModeType getFlushMode() Get the flush mode that applies to all objects contained in the persistence context. Returns: flushMode Since: JPA 1.0


Method javax.persistence.EntityManager EntityManagerFactory getEntityManagerFactory() Return the entity manager factory for the entity manager. Returns: EntityManagerFactory instance Throws: IllegalStateException - if the entity manager has been closed Since: JPA 2.0


Method javax.persistence.EntityManager void flush() Synchronize the persistence context to the underlying database. Throws: TransactionRequiredException - if there is no transaction PersistenceException - if the flush fails Since: JPA 1.0


Method javax.persistence.EntityManager void detach( Object entity ) Remove the given entity from the persistence context, causing a managed entity to become detached. Unflushed changes made to the entity if any (including removal of the entity), will not be synchronized to the database. Entities

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

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

Retrieving JPA Entity Objects

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

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

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

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

Getting Started

ObjectDB is very easy to use. Follow the Getting Started Tutorial and the Quick Tour manual chapter and in minutes you may be able to write and run first Java programs against ObjectDB.

Prior knowledge or experience in database programming (SQL, JDBC, ORM, JPA, etc.) is not required, but some background in using the Java language is essential.

Need Help?

  1. Search ObjectDB website
  2. Read the FAQ
  3. Follow the Tutorials
  4. View or post in the forum
  5. Search or file an issue
  6. Contact support