ObjectDB ObjectDB

Internal Website Search

81-90 of 200 resultsRefresh
15

InternalException during EntityManager.find()

InternalException during EntityManager.find()
14

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
12

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
12

Query Parameters in JPA

getCountryByName(EntityManager em, String name) { TypedQuery<Country> query = em.createQuery ... Country getCountryByName(EntityManager em, String name) { TypedQuery<Country> query = em ... without parameters: public Country getCountryByName(EntityManager em, String name) { TypedQuery
9

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
2

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
2

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
2

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
2

Step 3: Define an EJB Session Bean

.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.TypedQuery ... : @PersistenceContext private EntityManager em; // Stores a new guest: public void persist(Guest guest ... shown in the next step). Prepares an EntityManager automatically and injects it into the em field
1

Step 4: Add a Servlet Class

().getAttribute("emf"); EntityManager em = emf.createEntityManager(); try ... : The EntityManagerFactory is retrieved from the application scope attribute, and then an EntityManager

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