ObjectDB Database Search

1-50 of 200 results

Obtaining a JPA Database Connection

In JPA a database connection is represented by the EntityManager interface. Therefore, in order to manipulate an ObjectDB database we need an EntityManager instance. Operations that modify database ... an EntityManager instance consists of two steps. First we need to obtain an instance

Working with JPA Entity Objects

. In this state the object is not yet associated with an EntityManager and has no representation in ... via an EntityManager’s persist method, which must be invoked within an active transaction. On transaction commit, the owning EntityManager stores the new entity object to the database. More details on storing objects

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

Setting and Tuning of JPA Queries

on which they were invoked). Flush Mode (setFlushMode) Changes made to a database using an EntityManager em can be visible ... of other EntityManager instances). JPA implementations can easily make uncommitted changes visible in simple JPA ... , either at the  EntityManager level as a default for all the queries in that EntityManager or

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

Shared (L2) Entity Cache

Every EntityManager owns a persistence context , which is a collection of all the entity objects ... an entity object that is already managed by the  EntityManager returns the existing instance from ... context is one  EntityManager . This section describes a level 2  (L2) cache of entity

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 entity ... method except that if the entity object is not already managed by the EntityManager a hollow object

InterfaceRef jakarta.persistence.EntityManager

JPA Interface EntityManager Super Interfaces: AutoCloseable Interface used to interact with the persistence context. An instance of EntityManager must be obtained from an EntityManagerFactory ... . An application-managed EntityManager may be created via a call to () . The EntityManager must be explicitly

DELETE Queries in JPA/JPQL

: Retrieving the entity objects into an EntityManager . Removing these objects from the EntityManager   ... and then removing 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

EntityManager.runWithConnection(action) - JPA Method

JPA Method in jakarta.persistence. EntityManager void runWithConnection (    ... this EntityManager . Usually, the connection is a JDBC connection, but a provider might support some other native connection type, and is not required to support java.sql.Connection . If this EntityManager

EntityManager.callWithConnection(function) - JPA Method

JPA Method in jakarta.persistence. EntityManager T callWithConnection (    ... underlying this EntityManager . Usually, the connection is a JDBC connection, but a provider ... . If this EntityManager is associated with a transaction, the function is executed in the context

EntityManager.unwrap(cls) - JPA Method

JPA Method in jakarta.persistence. EntityManager T unwrap (   Class  cls ) Return ... implementation of EntityManager does not support the given type, the PersistenceException is thrown ... implementing {@code EntityManager } or an interface it implements. Return: an instance of the specified

EntityManager.close() - JPA Method

JPA Method in jakarta.persistence. EntityManager void close () Close an application-managed entity manager. After invocation of close() , every method of the EntityManager instance and of any instance of Query , TypedQuery , or StoredProcedureQuery obtained from it throws the IllegalStateException

EntityManager.getDelegate() - JPA Method

JPA Method in jakarta.persistence. EntityManager Object getDelegate () Return the underlying provider object for the EntityManager , if available. The result of this method is implementation-specific. The unwrap method is to be preferred for new applications. Return: the underlying provider object Since: JPA 1.0

EntityManager.getEntityGraphs(entityClass) - JPA Method

JPA Method in jakarta.persistence. EntityManager List getEntityGraphs (   Class  entityClass ) Return all named EntityGraph s that are defined for the given entity class type. Parameters: entityClass - entity class Return: list of all entity graphs defined for the entity Throws: IllegalArgumentException - if the class is not an entity Since: JPA 2.1

EntityManager.setCacheStoreMode(cacheStoreMode) - JPA Method

JPA Method in jakarta.persistence. EntityManager void setCacheStoreMode (    CacheStoreMode  cacheStoreMode ) Set the default plain for this persistence context. Parameters: cacheStoreMode - cache storage mode Since: JPA 3.2

EntityManager.setCacheRetrieveMode(cacheRetrieveMode) - JPA Method

JPA Method in jakarta.persistence. EntityManager void setCacheRetrieveMode (    CacheRetrieveMode  cacheRetrieveMode ) Set the default plain for this persistence context. Parameters: cacheRetrieveMode - cache retrieval mode Since: JPA 3.2

EntityManager.getCacheStoreMode() - JPA Method

JPA Method in jakarta.persistence. EntityManager CacheStoreMode getCacheStoreMode () The cache storage mode for this persistence context. Since: JPA 3.2

EntityManager.getCacheRetrieveMode() - JPA Method

JPA Method in jakarta.persistence. EntityManager CacheRetrieveMode getCacheRetrieveMode () The cache retrieval mode for this persistence context. Since: JPA 3.2

EntityManager.refresh(entity,options) - JPA Method

JPA Method in jakarta.persistence. EntityManager void refresh (   Object entity,    RefreshOption... options ) Refresh the state of the given managed entity instance from the database, using the specified plain, overwriting changes made to the entity, if any

EntityManager.merge(entity) - JPA Method

JPA Method in jakarta.persistence. EntityManager T merge (   T entity ) Merge the state of the given new or detached entity instance into the current persistence context, resulting in, respectively, an insert or possible update when the persistence context is synchronized

EntityManager.lock(entity,lockMode,options) - JPA Method

JPA Method in jakarta.persistence. EntityManager void lock (   Object entity,     LockModeType  lockMode,    LockOption... options ) Lock an entity instance belonging to the persistence context, obtaining the specified plain, using

EntityManager.persist(entity) - JPA Method

JPA Method in jakarta.persistence. EntityManager void persist (   Object entity ) Make a new entity instance managed and persistent, resulting in its insertion in the database when the persistence context is synchronized with the database, or make a removed entity managed, undoing

EntityManager.find(entityClass,primaryKey) - JPA Method

JPA Method in jakarta.persistence. EntityManager T find (   Class  entityClass,    Object primaryKey ) Find by primary key. Search for an entity of the specified class and primary key. If the entity instance is contained in the persistence context, it is returned

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

JPA Method in jakarta.persistence. EntityManager T find (   Class  entityClass,    Object primaryKey,    FindOption... options ) Find an instance of the given entity class by primary key, using the specified plain. Search for an entity

EntityManager.remove(entity) - JPA Method

JPA Method in jakarta.persistence. EntityManager void remove (   Object entity ) Mark a managed entity instance as removed, resulting in its deletion from the database when the persistence context is synchronized with the database. This operation cascades to every entity related by

EntityManager.getReference(entity) - JPA Method

JPA Method in jakarta.persistence. EntityManager T getReference (   T entity ) Obtain a reference to an instance of the entity class of the given object, with the same primary key as the given object, whose state may be lazily fetched. The given object may be persistent or detached

EntityManager.find(entityGraph,primaryKey,options) - JPA Method

JPA Method in jakarta.persistence. EntityManager T find (    EntityGraph  entityGraph,    Object primaryKey,    FindOption... options ) Find an instance of the root entity of the given EntityGraph by primary key, using the specified plain

EntityManager.createQuery(criteriaQuery) - JPA Method

JPA Method in jakarta.persistence. EntityManager TypedQuery createQuery (    CriteriaQuery  criteriaQuery ) Create an instance of TypedQuery for executing a criteria query. Parameters: criteriaQuery - a criteria query object Return: the new query instance Throws

EntityManager.createStoredProcedureQuery(procedureName,resultClasses) - JPA Method

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

EntityManager.createQuery(qlString) - JPA Method

JPA Method in jakarta.persistence. EntityManager Query createQuery (   String qlString ) Create an instance of Query for executing a Jakarta Persistence query language statement. Parameters: qlString - a Jakarta Persistence query string Return: the new query instance Throws

EntityManager.createQuery(deleteQuery) - JPA Method

JPA Method in jakarta.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.createQuery(updateQuery) - JPA Method

JPA Method in jakarta.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(selectQuery) - JPA Method

JPA Method in jakarta.persistence. EntityManager TypedQuery createQuery (    CriteriaSelect  selectQuery ) Create an instance of TypedQuery for executing a criteria query, which may be a union or intersection of top-level queries. Parameters: selectQuery - a criteria query object

EntityManager.createQuery(reference) - JPA Method

JPA Method in jakarta.persistence. EntityManager TypedQuery createQuery (    TypedQueryReference  reference ) Create an instance of TypedQuery for executing a named query written in the Jakarta Persistence query language or in native SQL. Parameters: reference - a reference

EntityManager.contains(entity) - JPA Method

JPA Method in jakarta.persistence. EntityManager boolean contains (   Object entity ) Determine if the given object is a managed entity instance belonging to the current persistence context. Parameters: entity - entity instance Return: boolean value indicating if entity belongs

EntityManager.detach(entity) - JPA Method

JPA Method in jakarta.persistence. EntityManager void detach (   Object entity ) Evict the given managed or removed entity from the persistence context, causing the entity to become immediately detached. Unflushed changes made to the entity, if any, including deletion of the entity

EntityManager.clear() - JPA Method

JPA Method in jakarta.persistence. EntityManager void clear () Clear the persistence context, causing all managed entities to become detached. Changes made to entities that have not already been flushed to the database will never be made persistent. Since: JPA 1.0

EntityManager.createNativeQuery(sqlString,resultClass) - JPA Method

JPA Method in jakarta.persistence. EntityManager Query createNativeQuery (   String sqlString,    Class  resultClass ) Create an instance of Query for executing a native SQL query. In the next release of this API, the return type of this method will change

EntityManager.refresh(entity,lockMode,properties) - JPA Method

JPA Method in jakarta.persistence. EntityManager void refresh (   Object entity,     LockModeType  lockMode,    Map  properties ) Refresh the state of the given managed entity instance from the database, overwriting unflushed changes

EntityManager.getProperties() - JPA Method

JPA Method in jakarta.persistence. EntityManager Map getProperties () The properties and hints and their associated values which are in effect for this entity manager. Modifying the contents of the returned map does not change the configuration in effect. Return: a map of properties and hints currently in effect Since: JPA 2.0

EntityManager.setProperty(propertyName,value) - JPA Method

JPA Method in jakarta.persistence. EntityManager void setProperty (   String propertyName,    Object value ) Set an entity manager property or hint. If a vendor-specific property or hint is not recognized, it is silently ignored. Parameters: propertyName - name

EntityManager.getLockMode(entity) - JPA Method

JPA Method in jakarta.persistence. EntityManager LockModeType getLockMode (   Object entity ) Get the current plain held by this persistence context on the given managed entity instance. Parameters: entity - a managed entity instance Return: the lock mode currently held Throws

EntityManager.lock(entity,lockMode,properties) - JPA Method

JPA Method in jakarta.persistence. EntityManager void lock (   Object entity,     LockModeType  lockMode,    Map  properties ) Lock an entity instance belonging to the persistence context, obtaining the specified plain, using the specified

EntityManager.lock(entity,lockMode) - JPA Method

JPA Method in jakarta.persistence. EntityManager void lock (   Object entity,     LockModeType  lockMode ) Lock an entity instance belonging to the persistence context, obtaining the specified plain. If a pessimistic lock mode type is specified and the entity

EntityManager.getFlushMode() - JPA Method

JPA Method in jakarta.persistence. EntityManager FlushModeType getFlushMode () Get the plain that applies to all objects contained in the persistence context. Return: the current {@link FlushModeType} Since: JPA 1.0

EntityManager.refresh(entity,lockMode) - JPA Method

JPA Method in jakarta.persistence. EntityManager void refresh (   Object entity,     LockModeType  lockMode ) Refresh the state of the given managed entity instance from the database, overwriting unflushed changes made to the entity, if any, and obtain the given

EntityManager.refresh(entity,properties) - JPA Method

JPA Method in jakarta.persistence. EntityManager void refresh (   Object entity,    Map  properties ) Refresh the state of the given managed entity instance from the database, using the specified properties, and overwriting unflushed changes made to the entity

EntityManager.refresh(entity) - JPA Method

JPA Method in jakarta.persistence. EntityManager void refresh (   Object entity ) Refresh the state of the given managed entity instance from the database, overwriting unflushed changes made to the entity, if any. This operation cascades to every entity related by an association

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

JPA Method in jakarta.persistence. EntityManager T find (   Class  entityClass,    Object primaryKey,     LockModeType  lockMode ) Find by primary key and obtain the given lock type for the resulting entity. Search for an entity