com.caucho.amber.manager
Class AmberConnection

java.lang.Object
  extended by com.caucho.amber.manager.AmberConnection
All Implemented Interfaces:
BeginResource, CloseResource, Synchronization
Direct Known Subclasses:
AmberEntityManager, CacheConnection

public class AmberConnection
extends java.lang.Object
implements BeginResource, CloseResource, Synchronization

The entity manager from a entity manager proxy.


Method Summary
 void addCompletion(AmberCompletion completion)
          Adds a completion
 void addEntity(Entity entity)
           
 Entity addNewEntity(java.lang.Class cl, java.lang.Object key)
          Adds a new entity for the given class name and key.
 void afterCommit(boolean isCommit)
          Commits a transaction.
 void afterCompletion(int status)
          Callback after a utrans commit.
 void beforeCommit()
          Called before the commit phase
 void beforeCompletion()
          Callback before a utrans commit.
 void begin(Transaction xa)
          Callback when the user transaction begins
 void beginTransaction()
          Starts a transaction.
 void cleanup()
          Cleans up the connection.
 void clear()
          Clears the connection
 void clear(java.lang.Object entity)
          Clears the entity
 void close()
          Closes the context.
static void close(java.sql.ResultSet rs)
           
 void closeStatement(java.lang.String sql)
          Closes a statement.
 void commit()
          Commits a transaction.
 boolean contains(java.lang.Object obj)
          Loads the object based on itself.
 void create(AmberEntityHome home, java.lang.Object obj)
          Saves the object.
 void create(java.lang.Object obj)
          Saves the object.
 void create(java.lang.String homeName, java.lang.Object obj)
          Saves the object.
 Query createNamedQuery(java.lang.String name)
          Creates an instance of the named query
 Query createNativeQuery(java.lang.String sql)
          Creates an instance of the named query
 Query createNativeQuery(java.lang.String sql, java.lang.Class type)
          Creates an instance of the native query
 Query createNativeQuery(java.lang.String sql, java.lang.String map)
          Creates an instance of the named query
 Query createQuery(java.lang.String sql)
          Creates a query.
 void delete(Entity entity)
          Deletes the object.
 void detach()
          Detach after non-xa.
 void expire()
          Expires the entities
 void finalize()
          Finalizer.
<T> T
find(java.lang.Class<T> entityClass, java.lang.Object primaryKey)
          Find by the primary key.
<T> T
find(java.lang.Class<T> entityCLass, java.lang.Object primaryKey, LockModeType lockMode)
          Find based on the primary key.
<T> T
find(java.lang.Class<T> entityCLass, java.lang.Object primaryKey, LockModeType lockMode, java.util.Map properties)
          Find based on the primary key.
 java.util.List find(java.lang.String hsql)
          Select a list of objects with a Hibernate query.
 EntityItem findEntityItem(java.lang.String name, java.lang.Object key)
          Loads the object with the given class.
 void flush()
          Flushes managed entities.
 void flushNoChecks()
          Flushes managed entities.
 void freeConnection()
          Frees the connection.
 AmberPersistenceUnit getAmberManager()
          Returns the amber manager.
 int getCacheChunkSize()
          Returns the cache chunk size.
 Entity getCacheEntity(java.lang.Class cl, java.lang.Object pk)
           
 Entity getCacheEntity(java.lang.Class cl, java.lang.Object pk, boolean isDebug)
           
 Entity getCacheEntity(Entity entity)
           
 Entity getCacheEntity(Entity entity, boolean isDebug)
           
 java.sql.Connection getConnection()
          Returns the connection.
 java.lang.Object getDelegate()
          Gets the delegate.
 Entity getEntity(java.lang.Class cl, java.lang.Object key)
          Matches the entity.
 Entity getEntity(Entity entity)
          Returns the context entity that corresponds to the entity passed in.
 Entity getEntity(EntityItem item)
          Returns the entity for the connection.
 Entity getEntity(int index)
           
 Entity getEntityLazy(EntityItem item)
          Returns the entity for the connection.
 EntityManagerFactory getEntityManagerFactory()
          Returns the owning factory
 FlushModeType getFlushMode()
          Returns the flush mode.
 LockModeType getLockMode(java.lang.Object entity)
          Returns the lock mode for the entity
 AmberPersistenceUnit getPersistenceUnit()
          Returns the persistence unit.
 java.util.Map getProperties()
          Returns the properties for the entity manager
 ResultSetCacheChunk getQueryCacheChunk(java.lang.String sql, java.lang.Object[] args, int startRow)
          Returns the cache chunk.
 java.sql.ResultSetMetaData getQueryMetaData()
          Returns the result set meta data from cache.
<T> T
getReference(java.lang.Class<T> entityClass, java.lang.Object primaryKey)
          Find by the primary key.
 Entity getSubEntity(java.lang.Class cl, java.lang.Object key)
           
 EntityItem getSubEntityCacheItem(java.lang.Class cl, java.lang.Object key)
          Gets the cache item referenced by __caucho_item from an entity of class/subclass cl.
 java.util.Set<java.lang.String> getSupportedProperties()
          Returns the supported properties for the entity manager
 EntityTransaction getTransaction()
          Returns the transaction.
 Entity getTransactionEntity(java.lang.Class cl, java.lang.Object key)
           
 Entity getTransactionEntity(int index)
           
 void initJta()
           
 void initThreadConnection()
          Set true for a threaded connection.
 boolean isActiveTransaction()
          Returns true if a transaction is active or this persistence context is extended.
 boolean isCacheEntity(Entity entity)
           
 boolean isInTransaction()
          Returns true if a transaction is active.
 boolean isJPA()
          Returns true for JPA.
 boolean isOpen()
          Returns true if open.
 void joinTransaction()
          Joins the transaction.
 java.lang.Object load(java.lang.Class cl, long intKey)
          Loads the object based on the class and primary key.
 java.lang.Object load(java.lang.Class cl, java.lang.Object key, boolean isEager)
           
 java.lang.Object load(java.lang.String entityName, java.lang.Object key)
          Loads the object based on the class and primary key.
 EntityItem loadCacheItem(java.lang.Class cl, java.lang.Object key, AmberEntityHome entityHome)
           
 Entity loadEntity(java.lang.Class cl, java.lang.Object key, boolean isEager)
          Adds a new entity for the given class name and key.
 Entity loadFromHome(java.lang.String name, java.lang.Object key)
          Loads the object with the given class.
 java.lang.Object loadLazy(java.lang.Class cl, long intKey)
          Loads the object based on the class and primary key.
 Entity loadLazy(java.lang.Class cl, java.lang.String name, java.lang.Object key)
          Loads the object with the given class.
 Entity loadLazy(java.lang.String className, java.lang.String name, java.lang.Object key)
          Loads the object with the given class.
 java.lang.Object loadProxy(EntityItem entityItem)
          Loads the CMP 2.1 object for the given entityItem
 java.lang.Object loadProxy(EntityType type, java.lang.Object key)
          Loads the object with the given class.
 java.lang.Object loadProxy(java.lang.String name, java.lang.Object key)
          Loads the object with the given class.
 void lock(java.lang.Object entity, LockModeType lockMode)
          Locks the object.
 void lock(java.lang.Object entity, LockModeType lockMode, java.util.Map properties)
          Sets the lock mode for an entity.
 java.lang.Object makePersistent(java.lang.Object obj)
          Loads the object based on itself.
<T> T
merge(T entityT)
          Merges the state of the entity into the current context.
 Entity mergeDetachedEntity(Entity newEntity)
           
 AbstractQuery parseQuery(java.lang.String sql, boolean isLazy)
          Creates a query object from a query string.
 void persist(java.lang.Object entityObject)
          Makes the instance managed.
 java.lang.Object persistFromCascade(java.lang.Object o)
          Makes the instance managed called from cascading operations.
 void popDepth()
          Pops the depth.
 java.sql.PreparedStatement prepareInsertStatement(java.lang.String sql, boolean isGeneratedId)
          Prepares an insert statement.
 AmberQuery prepareLazyQuery(java.lang.String queryString)
          Creates a query object from a query string.
 AmberQuery prepareQuery(java.lang.String queryString)
          Creates a query object from a query string.
 java.sql.PreparedStatement prepareStatement(java.lang.String sql)
          Prepares a statement.
 AmberQuery prepareUpdate(java.lang.String queryString)
          Creates a query object from a query string.
 void pushDepth()
          Pushes the depth.
 void putQueryCacheChunk(java.lang.String sql, java.lang.Object[] args, int startRow, ResultSetCacheChunk cacheChunk, java.sql.ResultSetMetaData cacheMetaData)
          Sets the cache chunk.
 java.sql.ResultSet query(java.lang.String hsql)
          Select a list of objects with a Hibernate query.
<T> T
recursiveMerge(T entityT)
          Recursively merges the state of the entity into the current context.
 void refresh(java.lang.Object entity)
          Refresh the state of the instance from the database.
 void refresh(java.lang.Object entity, LockModeType lockMode)
          Update the state of the instance from the database.
 void refresh(java.lang.Object entity, LockModeType lockMode, java.util.Map properties)
          Update the state of the instance from the database.
 void register(AmberCollection query)
          Registers a collection.
 void remove(java.lang.Object entity)
          Remove the instance.
 boolean removeEntity(Entity entity)
          Removes an entity.
 void rollback()
          Rollbacks a transaction.
 PersistenceException rollback(java.lang.Exception e)
           
 EntityItem setEntityItem(java.lang.String name, java.lang.Object key, EntityItem item)
          Loads the object with the given class.
 void setExtended(boolean isExtended)
          Sets the extended type.
 void setFlushMode(FlushModeType mode)
          Returns the flush mode.
 void setTransactionalState(Entity entity)
           
 void setXA(boolean isXA)
          Sets XA.
 boolean shouldRetrieveFromCache()
          Returns true when cache items can be used.
 java.lang.String toString()
           
 void update(Entity entity)
          Updates the object.
 void update(java.lang.Object obj)
          Updates the database with the values in object.
 int update(java.lang.String hsql)
          Updates the database with a query
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getPersistenceUnit

public AmberPersistenceUnit getPersistenceUnit()
Returns the persistence unit.


isJPA

public boolean isJPA()
Returns true for JPA.


initThreadConnection

public void initThreadConnection()
Set true for a threaded connection.


initJta

public void initJta()

persist

public void persist(java.lang.Object entityObject)
Makes the instance managed.


persistFromCascade

public java.lang.Object persistFromCascade(java.lang.Object o)
Makes the instance managed called from cascading operations.


merge

public <T> T merge(T entityT)
Merges the state of the entity into the current context.


remove

public void remove(java.lang.Object entity)
Remove the instance.


find

public <T> T find(java.lang.Class<T> entityClass,
                  java.lang.Object primaryKey)
Find by the primary key.


getReference

public <T> T getReference(java.lang.Class<T> entityClass,
                          java.lang.Object primaryKey)
               throws EntityNotFoundException,
                      java.lang.IllegalArgumentException
Find by the primary key.

Throws:
EntityNotFoundException
java.lang.IllegalArgumentException

clear

public void clear()
Clears the connection


createQuery

public Query createQuery(java.lang.String sql)
Creates a query.


createNamedQuery

public Query createNamedQuery(java.lang.String name)
Creates an instance of the named query


createNativeQuery

public Query createNativeQuery(java.lang.String sql)
Creates an instance of the named query


createNativeQuery

public Query createNativeQuery(java.lang.String sql,
                               java.lang.String map)
Creates an instance of the named query


createNativeQuery

public Query createNativeQuery(java.lang.String sql,
                               java.lang.Class type)
Creates an instance of the native query


refresh

public void refresh(java.lang.Object entity)
Refresh the state of the instance from the database.


getFlushMode

public FlushModeType getFlushMode()
Returns the flush mode.


setExtended

public void setExtended(boolean isExtended)
Sets the extended type.


setFlushMode

public void setFlushMode(FlushModeType mode)
Returns the flush mode.


lock

public void lock(java.lang.Object entity,
                 LockModeType lockMode)
Locks the object.


getTransaction

public EntityTransaction getTransaction()
Returns the transaction.


isOpen

public boolean isOpen()
Returns true if open.


joinTransaction

public void joinTransaction()
Joins the transaction.


getDelegate

public java.lang.Object getDelegate()
Gets the delegate.


close

public void close()
Closes the context.

Specified by:
close in interface CloseResource

getAmberManager

public AmberPersistenceUnit getAmberManager()
Returns the amber manager.


register

public void register(AmberCollection query)
Registers a collection.


addCompletion

public void addCompletion(AmberCompletion completion)
Adds a completion


isActiveTransaction

public boolean isActiveTransaction()
Returns true if a transaction is active or this persistence context is extended.


isInTransaction

public boolean isInTransaction()
Returns true if a transaction is active.


getCacheChunkSize

public int getCacheChunkSize()
Returns the cache chunk size.


load

public java.lang.Object load(java.lang.Class cl,
                             java.lang.Object key,
                             boolean isEager)
                      throws AmberException
Throws:
AmberException

loadCacheItem

public EntityItem loadCacheItem(java.lang.Class cl,
                                java.lang.Object key,
                                AmberEntityHome entityHome)
                         throws AmberException
Throws:
AmberException

load

public java.lang.Object load(java.lang.String entityName,
                             java.lang.Object key)
                      throws AmberException
Loads the object based on the class and primary key.

Throws:
AmberException

getEntity

public Entity getEntity(EntityItem item)
Returns the entity for the connection.


getEntityLazy

public Entity getEntityLazy(EntityItem item)
Returns the entity for the connection.


makePersistent

public java.lang.Object makePersistent(java.lang.Object obj)
                                throws java.sql.SQLException
Loads the object based on itself.

Throws:
java.sql.SQLException

loadLazy

public Entity loadLazy(java.lang.Class cl,
                       java.lang.String name,
                       java.lang.Object key)
Loads the object with the given class.


loadLazy

public Entity loadLazy(java.lang.String className,
                       java.lang.String name,
                       java.lang.Object key)
Loads the object with the given class.


findEntityItem

public EntityItem findEntityItem(java.lang.String name,
                                 java.lang.Object key)
Loads the object with the given class.


setEntityItem

public EntityItem setEntityItem(java.lang.String name,
                                java.lang.Object key,
                                EntityItem item)
Loads the object with the given class.


loadFromHome

public Entity loadFromHome(java.lang.String name,
                           java.lang.Object key)
Loads the object with the given class.

Parameters:
name - the class name.
key - the key.
notExpiringLoadMask - the load mask bit that will not be reset when the entity is expiring and reloaded to a new transaction. Normally, the bit is only set in bidirectional one-to-one relationships where we already know the other side has already been loaded in the second or new transactions.
notExpiringGroup - the corresponding load group.

loadProxy

public java.lang.Object loadProxy(java.lang.String name,
                                  java.lang.Object key)
Loads the object with the given class.


loadProxy

public java.lang.Object loadProxy(EntityType type,
                                  java.lang.Object key)
Loads the object with the given class.


loadProxy

public java.lang.Object loadProxy(EntityItem entityItem)
Loads the CMP 2.1 object for the given entityItem


load

public java.lang.Object load(java.lang.Class cl,
                             long intKey)
                      throws AmberException
Loads the object based on the class and primary key.

Throws:
AmberException

loadLazy

public java.lang.Object loadLazy(java.lang.Class cl,
                                 long intKey)
                          throws AmberException
Loads the object based on the class and primary key.

Throws:
AmberException

getEntity

public Entity getEntity(java.lang.Class cl,
                        java.lang.Object key)
Matches the entity.


getEntity

public Entity getEntity(int index)

getEntity

public Entity getEntity(Entity entity)
Returns the context entity that corresponds to the entity passed in. The entity passed in is normally a cache entity but might be the context entity itself when we want to make sure the reference is to an entity in the persistence context.


getSubEntity

public Entity getSubEntity(java.lang.Class cl,
                           java.lang.Object key)

getSubEntityCacheItem

public EntityItem getSubEntityCacheItem(java.lang.Class cl,
                                        java.lang.Object key)
Gets the cache item referenced by __caucho_item from an entity of class/subclass cl.


getTransactionEntity

public Entity getTransactionEntity(java.lang.Class cl,
                                   java.lang.Object key)

getTransactionEntity

public Entity getTransactionEntity(int index)

addNewEntity

public Entity addNewEntity(java.lang.Class cl,
                           java.lang.Object key)
                    throws java.lang.InstantiationException,
                           java.lang.IllegalAccessException
Adds a new entity for the given class name and key. The new entity object is supposed to be used as a copy from cache. This avoids the cache entity to be added to the context.

Returns:
null - if the entity is already in the context. otherwise, it returns the new entity added to the context.
Throws:
java.lang.InstantiationException
java.lang.IllegalAccessException

loadEntity

public Entity loadEntity(java.lang.Class cl,
                         java.lang.Object key,
                         boolean isEager)
Adds a new entity for the given class name and key.


removeEntity

public boolean removeEntity(Entity entity)
Removes an entity.


contains

public boolean contains(java.lang.Object obj)
Loads the object based on itself.


begin

public void begin(Transaction xa)
Callback when the user transaction begins

Specified by:
begin in interface BeginResource

beginTransaction

public void beginTransaction()
                      throws java.sql.SQLException
Starts a transaction.

Throws:
java.sql.SQLException

setXA

public void setXA(boolean isXA)
Sets XA.


commit

public void commit()
            throws java.sql.SQLException
Commits a transaction.

Throws:
java.sql.SQLException

beforeCompletion

public void beforeCompletion()
Callback before a utrans commit.

Specified by:
beforeCompletion in interface Synchronization

afterCompletion

public void afterCompletion(int status)
Callback after a utrans commit.

Specified by:
afterCompletion in interface Synchronization

beforeCommit

public void beforeCommit()
                  throws java.sql.SQLException
Called before the commit phase

Throws:
java.sql.SQLException

afterCommit

public void afterCommit(boolean isCommit)
Commits a transaction.


rollback

public PersistenceException rollback(java.lang.Exception e)

rollback

public void rollback()
              throws java.sql.SQLException
Rollbacks a transaction.

Throws:
java.sql.SQLException

flush

public void flush()
Flushes managed entities.


flushNoChecks

public void flushNoChecks()
Flushes managed entities.


expire

public void expire()
            throws java.sql.SQLException
Expires the entities

Throws:
java.sql.SQLException

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Returns the connection.

Throws:
java.sql.SQLException

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql)
                                            throws java.sql.SQLException
Prepares a statement.

Throws:
java.sql.SQLException

closeStatement

public void closeStatement(java.lang.String sql)
                    throws java.sql.SQLException
Closes a statement.

Throws:
java.sql.SQLException

close

public static void close(java.sql.ResultSet rs)

prepareInsertStatement

public java.sql.PreparedStatement prepareInsertStatement(java.lang.String sql,
                                                         boolean isGeneratedId)
                                                  throws java.sql.SQLException
Prepares an insert statement.

Throws:
java.sql.SQLException

update

public void update(java.lang.Object obj)
Updates the database with the values in object. If the object does not exist, throws an exception.

Parameters:
obj - the object to update

create

public void create(java.lang.Object obj)
            throws java.sql.SQLException
Saves the object.

Parameters:
obj - the object to create
Throws:
java.sql.SQLException

create

public void create(java.lang.String homeName,
                   java.lang.Object obj)
            throws java.sql.SQLException
Saves the object.

Parameters:
obj - the object to create
Throws:
java.sql.SQLException

create

public void create(AmberEntityHome home,
                   java.lang.Object obj)
            throws java.sql.SQLException
Saves the object.

Parameters:
obj - the object to create
Throws:
java.sql.SQLException

update

public void update(Entity entity)
Updates the object.


delete

public void delete(Entity entity)
            throws java.sql.SQLException
Deletes the object.

Parameters:
obj - the object to delete
Throws:
java.sql.SQLException

prepareQuery

public AmberQuery prepareQuery(java.lang.String queryString)
                        throws AmberException
Creates a query object from a query string.

Parameters:
query - a Hibernate query
Throws:
AmberException

prepareLazyQuery

public AmberQuery prepareLazyQuery(java.lang.String queryString)
                            throws AmberException
Creates a query object from a query string.

Parameters:
query - a Hibernate query
Throws:
AmberException

prepareUpdate

public AmberQuery prepareUpdate(java.lang.String queryString)
                         throws AmberException
Creates a query object from a query string.

Parameters:
query - a Hibernate query
Throws:
AmberException

parseQuery

public AbstractQuery parseQuery(java.lang.String sql,
                                boolean isLazy)
                         throws AmberException
Creates a query object from a query string.

Parameters:
query - a Hibernate query
Throws:
AmberException

query

public java.sql.ResultSet query(java.lang.String hsql)
                         throws java.sql.SQLException
Select a list of objects with a Hibernate query.

Parameters:
query - the hibernate query
Returns:
the query results.
Throws:
java.sql.SQLException

getQueryCacheChunk

public ResultSetCacheChunk getQueryCacheChunk(java.lang.String sql,
                                              java.lang.Object[] args,
                                              int startRow)
Returns the cache chunk.

Parameters:
sql - the SQL for the cache chunk
args - the filled parameters for the cache chunk
startRow - the starting row for the cache chunk

getQueryMetaData

public java.sql.ResultSetMetaData getQueryMetaData()
Returns the result set meta data from cache.


putQueryCacheChunk

public void putQueryCacheChunk(java.lang.String sql,
                               java.lang.Object[] args,
                               int startRow,
                               ResultSetCacheChunk cacheChunk,
                               java.sql.ResultSetMetaData cacheMetaData)
Sets the cache chunk.

Parameters:
sql - the SQL for the cache chunk
args - the filled parameters for the cache chunk
startRow - the starting row for the cache chunk
cacheChunk - the new value of the cache chunk

update

public int update(java.lang.String hsql)
           throws java.sql.SQLException
Updates the database with a query

Parameters:
query - the hibernate query
Returns:
the query results.
Throws:
java.sql.SQLException

find

public java.util.List find(java.lang.String hsql)
                    throws java.sql.SQLException
Select a list of objects with a Hibernate query.

Parameters:
query - the hibernate query
Returns:
the query results.
Throws:
java.sql.SQLException

cleanup

public void cleanup()
Cleans up the connection.


pushDepth

public void pushDepth()
Pushes the depth.


popDepth

public void popDepth()
Pops the depth.


freeConnection

public void freeConnection()
Frees the connection.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

finalize

public void finalize()
Finalizer.

Overrides:
finalize in class java.lang.Object

shouldRetrieveFromCache

public boolean shouldRetrieveFromCache()
Returns true when cache items can be used.


setTransactionalState

public void setTransactionalState(Entity entity)

isCacheEntity

public boolean isCacheEntity(Entity entity)

getCacheEntity

public Entity getCacheEntity(Entity entity)

getCacheEntity

public Entity getCacheEntity(Entity entity,
                             boolean isDebug)

getCacheEntity

public Entity getCacheEntity(java.lang.Class cl,
                             java.lang.Object pk)

getCacheEntity

public Entity getCacheEntity(java.lang.Class cl,
                             java.lang.Object pk,
                             boolean isDebug)

detach

public void detach()
Detach after non-xa.


find

public <T> T find(java.lang.Class<T> entityCLass,
                  java.lang.Object primaryKey,
                  LockModeType lockMode)
Find based on the primary key.

Since:
JPA 2.0

find

public <T> T find(java.lang.Class<T> entityCLass,
                  java.lang.Object primaryKey,
                  LockModeType lockMode,
                  java.util.Map properties)
Find based on the primary key.

Since:
JPA 2.0

lock

public void lock(java.lang.Object entity,
                 LockModeType lockMode,
                 java.util.Map properties)
Sets the lock mode for an entity.

Since:
JPA 2.0

refresh

public void refresh(java.lang.Object entity,
                    LockModeType lockMode)
Update the state of the instance from the database.

Since:
JPA 2.0

refresh

public void refresh(java.lang.Object entity,
                    LockModeType lockMode,
                    java.util.Map properties)
Update the state of the instance from the database.

Since:
JPA 2.0

clear

public void clear(java.lang.Object entity)
Clears the entity

Since:
JPA 2.0

getLockMode

public LockModeType getLockMode(java.lang.Object entity)
Returns the lock mode for the entity

Since:
JPA 2.0

getProperties

public java.util.Map getProperties()
Returns the properties for the entity manager

Since:
JPA 2.0

getSupportedProperties

public java.util.Set<java.lang.String> getSupportedProperties()
Returns the supported properties for the entity manager

Since:
JPA 2.0

getEntityManagerFactory

public EntityManagerFactory getEntityManagerFactory()
Returns the owning factory

Since:
JPA 2.0

recursiveMerge

public <T> T recursiveMerge(T entityT)
Recursively merges the state of the entity into the current context.


mergeDetachedEntity

public Entity mergeDetachedEntity(Entity newEntity)

addEntity

public void addEntity(Entity entity)