ObjectDB Database Search

51-100 of 200 results

EntityManager.createQuery(updateQuery) - JPA Method

JPA Method in javax.persistence. EntityManager Query createQuery (    CriteriaUpdate  updateQuery ) Create an instance of Query for executing a criteria update query. Parameters: updateQuery - a criteria update query object Return: the new query instance Throws

EntityManager.createQuery(deleteQuery) - JPA Method

JPA Method in javax.persistence. EntityManager Query createQuery (    CriteriaDelete  deleteQuery ) Create an instance of Query for executing a criteria delete query. Parameters: deleteQuery - a criteria delete query object Return: the new query instance Throws

EntityManager.find(entityClass,primaryKey,properties) - JPA Method

JPA Method in jakarta.persistence. EntityManager T find (   Class  entityClass,    Object primaryKey,    Map  properties ) Find by primary key, using the specified properties. Search for an entity of the specified class and primary key

EntityManager.setFlushMode(flushMode) - JPA Method

JPA Method in jakarta.persistence. EntityManager void setFlushMode (    FlushModeType  flushMode ) Set the plain that applies to all objects contained in the persistence context. Parameters: flushMode - flush mode Since: JPA 1.0

EntityManager.flush() - JPA Method

JPA Method in jakarta.persistence. EntityManager void flush () Synchronize changes held in the persistence context to the underlying database. Throws: TransactionRequiredException - if there is no transaction or if the entity manager has not been joined to the current transaction PersistenceException - if the flush fails Since: JPA 1.0

EntityManager.getReference(entityClass,primaryKey) - JPA Method

JPA Method in jakarta.persistence. EntityManager T getReference (   Class  entityClass,    Object primaryKey ) Obtain a reference to an instance of the given entity class with the given primary key, whose state may be lazily fetched. If the requested instance does

EntityManager.find(entityClass,primaryKey,lockMode,properties) - JPA Method

JPA Method in jakarta.persistence. EntityManager T find (   Class  entityClass,    Object primaryKey,     LockModeType  lockMode,    Map  properties ) Find by primary key and lock the entity, using the specified properties

EntityManager.createEntityGraph(rootType) - JPA Method

JPA Method in jakarta.persistence. EntityManager EntityGraph createEntityGraph (   Class  rootType ) Create a new mutable EntityGraph , allowing dynamic definition of an entity graph. Parameters: rootType - class of entity graph Return: entity graph Since: JPA 2.1

EntityManager.getMetamodel() - JPA Method

JPA Method in jakarta.persistence. EntityManager Metamodel getMetamodel () Obtain an instance of the Metamodel interface which provides access to metamodel objects describing the managed types belonging to the persistence unit. Return: an instance of {@link Metamodel} Throws: IllegalStateException - if the entity manager has been closed Since: JPA 2.0

EntityManager.getCriteriaBuilder() - JPA Method

JPA Method in jakarta.persistence. EntityManager CriteriaBuilder getCriteriaBuilder () Obtain an instance of CriteriaBuilder which may be used to construct CriteriaQuery objects. Return: an instance of {@link CriteriaBuilder} Throws: IllegalStateException - if the entity manager has been closed See Also: EntityManagerFactory.getCriteriaBuilder () Since: JPA 2.0

EntityManager.getEntityManagerFactory() - JPA Method

JPA Method in jakarta.persistence. EntityManager EntityManagerFactory getEntityManagerFactory () The plain which created this entity manager. Return: the {@link EntityManagerFactory} Throws: IllegalStateException - if the entity manager has been closed Since: JPA 2.0

EntityManager.getEntityGraph(graphName) - JPA Method

JPA Method in jakarta.persistence. EntityManager EntityGraph getEntityGraph (   String graphName ) Obtain a named EntityGraph . The returned instance of EntityGraph should be considered immutable. Parameters: graphName - name of an existing entity graph Return: named entity graph

EntityManager.createEntityGraph(graphName) - JPA Method

JPA Method in jakarta.persistence. EntityManager EntityGraph createEntityGraph (   String graphName ) Obtain a mutable copy of a named EntityGraph , or return null if there is no entity graph with the given name. Parameters: graphName - name of an entity graph Return: entity graph Since: JPA 2.1

EntityManager.isJoinedToTransaction() - JPA Method

JPA Method in jakarta.persistence. EntityManager boolean isJoinedToTransaction () Determine whether the entity manager is joined to the current transaction. Returns false if the entity manager is not joined to the current transaction or if no transaction is active. Return: boolean Since: JPA 2.1

EntityManager.joinTransaction() - JPA Method

JPA Method in jakarta.persistence. EntityManager void joinTransaction () Indicate to the entity manager that a JTA transaction is active and join the persistence context to it. This method should be called on a JTA application managed entity manager that was created outside the scope of the active

EntityManager.getTransaction() - JPA Method

JPA Method in jakarta.persistence. EntityManager EntityTransaction getTransaction () Return the resource-level EntityTransaction object. The EntityTransaction instance may be used serially to begin and commit multiple transactions. Return: EntityTransaction instance Throws: IllegalStateException - if invoked on a JTA entity manager Since: JPA 1.0

EntityManager.isOpen() - JPA Method

JPA Method in jakarta.persistence. EntityManager boolean isOpen () Determine whether the entity manager is open. Return: true until the entity manager has been closed Since: JPA 1.0

EntityManager.createStoredProcedureQuery(procedureName) - JPA Method

JPA Method in jakarta.persistence. EntityManager StoredProcedureQuery createStoredProcedureQuery (   String procedureName ) Create an instance of StoredProcedureQuery for executing a stored procedure in the database. Parameters must be registered before the stored procedure

EntityManager.createNamedStoredProcedureQuery(name) - JPA Method

JPA Method in jakarta.persistence. EntityManager StoredProcedureQuery createNamedStoredProcedureQuery (   String name ) Create an instance of StoredProcedureQuery for executing a stored procedure in the database. Parameters must be registered before the stored procedure

EntityManager.createNativeQuery(sqlString,resultSetMapping) - JPA Method

JPA Method in jakarta.persistence. EntityManager Query createNativeQuery (   String sqlString,    String resultSetMapping ) Create an instance of Query for executing a native SQL query. Parameters: sqlString - a native SQL query string resultSetMapping - the name

EntityManager.createStoredProcedureQuery(procedureName,resultSetMappings) - JPA Method

JPA Method in jakarta.persistence. EntityManager StoredProcedureQuery createStoredProcedureQuery (   String procedureName,    String... resultSetMappings ) Create an instance of StoredProcedureQuery for executing a stored procedure in the database. Parameters

EntityManager.createStoredProcedureQuery(procedureName,resultClasses) - JPA Method

JPA Method in javax.persistence. EntityManager StoredProcedureQuery createStoredProcedureQuery (   String procedureName,    Class... resultClasses ) Create an instance of StoredProcedureQuery for executing a stored procedure in the database. Parameters

EntityManager.createNamedQuery(name) - JPA Method

JPA Method in jakarta.persistence. EntityManager Query createNamedQuery (   String name ) Create an instance of Query for executing a named query written in the Jakarta Persistence query language or in native SQL. Parameters: name - the name of a query defined in metadata Return

EntityManager.createQuery(qlString,resultClass) - JPA Method

JPA Method in jakarta.persistence. EntityManager TypedQuery createQuery (   String qlString,    Class  resultClass ) Create an instance of TypedQuery for executing a Jakarta Persistence query language statement. The select list of the query must contain

EntityManager.createNativeQuery(sqlString,resultClass) - JPA Method

JPA Method in javax.persistence. EntityManager Query createNativeQuery (   String sqlString,    Class resultClass ) Create an instance of Query for executing a native SQL query. Parameters: sqlString - a native SQL query string resultClass - the class

EntityManager.createNativeQuery(sqlString) - JPA Method

JPA Method in jakarta.persistence. EntityManager Query createNativeQuery (   String sqlString ) Create an instance of Query for executing a native SQL statement, e.g., for update or delete. If the query is not an update or delete query, query execution will result in each row

EntityManager.createNamedQuery(name,resultClass) - JPA Method

JPA Method in jakarta.persistence. EntityManager TypedQuery createNamedQuery (   String name,    Class  resultClass ) Create an instance of TypedQuery for executing a Jakarta Persistence query language named query. The select list of the query must contain

UPDATE SET Queries in JPA/JPQL

the entity objects into an EntityManager . Updating the relevant entity object fields  ... and then updating them, but it should be used cautiously because bypassing the EntityManager  may break its synchronization with the database. For example, the EntityManager may not be aware

Locking in JPA

(using another EntityManager ) since it was retrieved by the current updater. Optimistic locking ... another EntityManager instance) currently holds a PESSIMISTIC_WRITE lock on that database object ... . lock (e1, lockMode1); em2. lock (e2, lockMode2); em1 and em2 are two EntityManager instances

JPA Lifecycle Events

is invoked: @PrePersist - before a new entity is persisted (added to the EntityManager ... the EntityManager . @PostUpdate - after updating an entity in the database (during commit or flush ). @PreRemove - when an entity is marked for removal in the EntityManager . @PostRemove

Query Parameters in JPA

getCountryByName( EntityManager em, String name) { TypedQuery query = em. createQuery ( "SELECT c FROM ... ( EntityManager em, String name) { TypedQuery query = em. createQuery ( "SELECT c FROM Country c ... ( EntityManager em, String name) { TypedQuery query = em. createQuery ( "SELECT c FROM Country c

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 query ... that are retrieved directly by a result path expression are not associated with an EntityManager and changes

Storing JPA Entity Objects

is New. An explicit call to persist associates the object with an owner EntityManager em and changes ... managed by the EntityManager ) or by commit . Referenced Embedded Objects The following code stores

JPA Metamodel API

method or 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

Entity Management Settings

the reference type for holding non dirty entities in the persistence context of the EntityManager ... that is managed by the EntityManagerFactory and shared by all its EntityManager instances. The level 2 cache

JPA Queries

the EntityManagerFactory 's getCriteriaBuilder method or by the  EntityManager 's

JPA Named Queries

but different EntityManager factory methods are used to instantiate them. The createNamedQuery method

JPA Query API

with an EntityManager (represented by em in the following code snippets), which serves as a factory

CRUD Database Operations with JPA

Given an EntityManager , em , that represents a JPA connection to the object database, we can use it to store, retrieve, update and delete database objects. Storing New Entity Objects The following code fragment stores 1,000 Point  objects in the database: em. getTransaction (). begin

Posting Sample Code

; EntityManager em = emf.createEntityManager();         em

Step 3: Define an EJB Session Bean

java.util.List; import javax.ejb.Stateless; import javax.persistence. EntityManager ; import javax ... { // Injected database connection: @PersistenceContext private EntityManager em; // Stores a new guest ... ; next step ). Prepares an  EntityManager automatically and injects it into the  em field

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: @Transactional public ... the controller, as shown in the next step. Prepares an  EntityManager automatically and injects

Step 3: Define a Spring DAO Component

.List; import javax.persistence. EntityManager ; import javax.persistence.PersistenceContext; import ... connection: @PersistenceContext private EntityManager em; // Stores a new guest: @Transactional public ... the controller, as shown in the next step. Prepares an  EntityManager automatically and injects

Step 3: Define an EJB Session Bean

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

Step 4: Add a Servlet Class

)getServletContext().getAttribute("emf"); EntityManager em = emf.createEntityManager(); try { // Handle ... is retrieved from the application scope attribute, and then an EntityManager (representing a database

Step 4: Add a Servlet Class

: EntityManagerFactory emf = (EntityManagerFactory)getServletContext().getAttribute("emf"); EntityManager em ... , and then an EntityManager (representing a database connection) is constructed. If a new guest has registered

Step 6: Set the Spring XML

and transactions), to inject a JPA  EntityManager , to manage transactions and to look for JSP pages in

Step 6: Set the Spring XML

, controllers and transactions), to inject a JPA EntityManager , to manage transactions and to look

Step 3: Add a Main Class

;          "$objectdb/db/p2.odb"); EntityManager em

Step 3: Add a Main Class

;        "$objectdb/db/p2.odb"); EntityManager em = emf