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

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

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

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

javax.persistence.EntityManager

JPA 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 of entity ... . Within the persistence context, the entity instances and their lifecycle are managed. The EntityManager API is used

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.unwrap(cls) - JPA Method

JPA Method in javax.persistence. EntityManager T unwrap (   Class  cls ) Return ... EntityManager implementation does not support the specified class, the PersistenceException is thrown ... EntityManager implementation class or an interface that it implements. Return: an instance of the specified

EntityManager.getDelegate() - JPA Method

JPA Method in javax.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: underlying provider object for EntityManager Since: JPA 1.0

EntityManager.close() - JPA Method

JPA Method in javax.persistence. EntityManager void close () Close an application-managed entity manager. After the close method has been invoked, all methods on the EntityManager instance and any Query , TypedQuery , and StoredProcedureQuery objects obtained from it will throw

EntityManager.persist(entity) - JPA Method

JPA Method in javax.persistence. EntityManager void persist (   Object entity ) Make an instance managed and persistent. Parameters: entity - entity instance Throws: EntityExistsException - if the entity already exists. (If the entity already exists, the EntityExistsException

EntityManager.merge(entity) - JPA Method

JPA Method in javax.persistence. EntityManager T merge (   T entity ) Merge the state of the given entity into the current persistence context. Parameters: entity - entity instance Return: the managed instance that the state was merged to Throws: IllegalArgumentException

EntityManager.remove(entity) - JPA Method

JPA Method in javax.persistence. EntityManager void remove (   Object entity ) Remove the entity instance. Parameters: entity - entity instance Throws: IllegalArgumentException - if the instance is not an entity or is a detached entity TransactionRequiredException - if invoked

EntityManager.find(entityClass,primaryKey) - JPA Method

JPA Method in javax.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,properties) - JPA Method

JPA Method in javax.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.find(entityClass,primaryKey,lockMode) - JPA Method

JPA Method in javax.persistence. EntityManager T find (   Class  entityClass,    Object primaryKey,     LockModeType  lockMode ) Find by primary key and lock. Search for an entity of the specified class and primary key and lock it with respect

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

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

EntityManager.getReference(entityClass,primaryKey) - JPA Method

JPA Method in javax.persistence. EntityManager T getReference (   Class  entityClass,    Object primaryKey ) Get an instance, whose state may be lazily fetched. If the requested instance does not exist in the database, the EntityNotFoundException is thrown

EntityManager.flush() - JPA Method

JPA Method in javax.persistence. EntityManager void flush () Synchronize 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.setFlushMode(flushMode) - JPA Method

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

EntityManager.getFlushMode() - JPA Method

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

EntityManager.lock(entity,lockMode) - JPA Method

JPA Method in javax.persistence. EntityManager void lock (   Object entity,     LockModeType  lockMode ) Lock an entity instance that is contained in the persistence context with the specified lock mode type. If a pessimistic lock mode type is specified

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

JPA Method in javax.persistence. EntityManager void lock (   Object entity,     LockModeType  lockMode,    Map  properties ) Lock an entity instance that is contained in the persistence context with the specified lock mode type

EntityManager.refresh(entity) - JPA Method

JPA Method in javax.persistence. EntityManager void refresh (   Object entity ) Refresh the state of the instance from the database, overwriting changes made to the entity, if any. Parameters: entity - entity instance Throws: IllegalArgumentException - if the instance is not

EntityManager.refresh(entity,properties) - JPA Method

JPA Method in javax.persistence. EntityManager void refresh (   Object entity,    Map  properties ) Refresh the state of the instance from the database, using the specified properties, and overwriting changes made to the entity, if any. If a vendor-specific

EntityManager.refresh(entity,lockMode) - JPA Method

JPA Method in javax.persistence. EntityManager void refresh (   Object entity,     LockModeType  lockMode ) Refresh the state of the instance from the database, overwriting changes made to the entity, if any, and lock it with respect to given lock mode type

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

JPA Method in javax.persistence. EntityManager void refresh (   Object entity,     LockModeType  lockMode,    Map  properties ) Refresh the state of the instance from the database, overwriting changes made to the entity, if any, and lock

EntityManager.clear() - JPA Method

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

EntityManager.detach(entity) - JPA Method

JPA Method in 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

EntityManager.contains(entity) - JPA Method

JPA Method in javax.persistence. EntityManager boolean contains (   Object entity ) Check if the instance is a managed entity instance belonging to the current persistence context. Parameters: entity - entity instance Return: boolean indicating if entity is in persistence context

EntityManager.getLockMode(entity) - JPA Method

JPA Method in javax.persistence. EntityManager LockModeType getLockMode (   Object entity ) Get the current lock mode for the entity instance. Parameters: entity - entity instance Return: lock mode Throws: TransactionRequiredException - if there is no transaction or if the entity

EntityManager.setProperty(propertyName,value) - JPA Method

JPA Method in javax.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.getProperties() - JPA Method

JPA Method in javax.persistence. EntityManager Map getProperties () Get the properties and hints and associated values that are in effect for the entity manager. Changing the contents of the map does not change the configuration in effect. Return: map of properties and hints in effect for entity manager Since: JPA 2.0

EntityManager.createQuery(qlString) - JPA Method

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

EntityManager.createQuery(criteriaQuery) - JPA Method

JPA Method in javax.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.createQuery(qlString,resultClass) - JPA Method

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

EntityManager.createNamedQuery(name) - JPA Method

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

EntityManager.createNamedQuery(name,resultClass) - JPA Method

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

EntityManager.createNativeQuery(sqlString) - JPA Method

JPA Method in javax.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.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,resultSetMapping) - JPA Method

JPA Method in javax.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.createNamedStoredProcedureQuery(name) - JPA Method

JPA Method in javax.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 can be executed

EntityManager.createStoredProcedureQuery(procedureName) - JPA Method

JPA Method in javax.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.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.createStoredProcedureQuery(procedureName,resultSetMappings) - JPA Method

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

EntityManager.joinTransaction() - JPA Method

JPA Method in javax.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.isJoinedToTransaction() - JPA Method

JPA Method in javax.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.isOpen() - JPA Method

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