com.caucho.amber.manager
Class EntityManagerExtendedProxy

java.lang.Object
  extended by com.caucho.amber.manager.EntityManagerExtendedProxy
All Implemented Interfaces:
EntityManager

public class EntityManagerExtendedProxy
extends java.lang.Object
implements EntityManager

The Entity manager


Constructor Summary
EntityManagerExtendedProxy(AmberPersistenceUnit persistenceUnit)
           
 
Method Summary
 void clear()
          Clears the manager.
 void close()
          Clears the manager.
 boolean contains(java.lang.Object entity)
          Returns true if the entity belongs to the current context.
 Query createNamedQuery(java.lang.String sql)
          Creates an instance of the named query
<T> TypedQuery<T>
createNamedQuery(java.lang.String name, java.lang.Class<T> resultClass)
          Creates a named query.
 Query createNativeQuery(java.lang.String sql)
          Creates a query.
 Query createNativeQuery(java.lang.String sql, java.lang.Class retType)
          Creates a query.
 Query createNativeQuery(java.lang.String sql, java.lang.String map)
          Creates a query.
<T> TypedQuery<T>
createQuery(CriteriaQuery<T> criteriaQuery)
          Creates a TypedQuery for a criteria
 Query createQuery(java.lang.String sql)
          Creates a query.
<T> TypedQuery<T>
createQuery(java.lang.String qlString, java.lang.Class<T> resultClass)
          Creates a TypedQuery for a criteria
 void detach(java.lang.Object entity)
          Clears the entity
<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<java.lang.String,java.lang.Object> properties)
          Find based on the primary key.
<T> T
find(java.lang.Class<T> entityCLass, java.lang.Object primaryKey, java.util.Map<java.lang.String,java.lang.Object> properties)
          Find based on the primary key.
 void flush()
          Synchronize with the database.
 CriteriaBuilder getCriteriaBuilder()
          Returns a CriteriaBuilder to create CriteriaQuery objects.
 java.lang.Object getDelegate()
          Gets the delegate.
 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
 Metamodel getMetamodel()
          Returns the Metamodel interface for the persistence unit.
 java.util.Map<java.lang.String,java.lang.Object> getProperties()
          Returns the properties for the entity manager
<T> T
getReference(java.lang.Class<T> entityClass, java.lang.Object primaryKey)
          Find by the primary key.
 EntityTransaction getTransaction()
          Returns the entity manager transaction.
 boolean isOpen()
          Returns true if open.
 void joinTransaction()
          Joins the transaction.
 void lock(java.lang.Object entity, LockModeType lockMode)
          Locks the object.
 void lock(java.lang.Object entity, LockModeType lockMode, java.util.Map<java.lang.String,java.lang.Object> properties)
          Sets the lock mode for an entity.
<T> T
merge(T entity)
          Merges the state of the entity into the current context.
 void persist(java.lang.Object entity)
          Makes the instance managed.
 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<java.lang.String,java.lang.Object> properties)
          Update the state of the instance from the database.
 void refresh(java.lang.Object entity, java.util.Map<java.lang.String,java.lang.Object> properties)
          Update the state of the instance from the database.
 void remove(java.lang.Object entity)
          Remove the instance.
 void setExtended(boolean isExtended)
          Sets the extended type.
 void setFlushMode(FlushModeType mode)
          Sets the flush mode.
 void setProperty(java.lang.String propertyName, java.lang.Object value)
          Sets properties for the entity manager
 java.lang.String toString()
           
<T> T
unwrap(java.lang.Class<T> cls)
          Returns the object of the type for a provider-specific API
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EntityManagerExtendedProxy

public EntityManagerExtendedProxy(AmberPersistenceUnit persistenceUnit)
Method Detail

persist

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

Specified by:
persist in interface EntityManager

merge

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

Specified by:
merge in interface EntityManager

remove

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

Specified by:
remove in interface EntityManager

find

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

Specified by:
find in interface EntityManager

getReference

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

Specified by:
getReference in interface EntityManager

getFlushMode

public FlushModeType getFlushMode()
Returns the flush mode.

Specified by:
getFlushMode in interface EntityManager

setFlushMode

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

Specified by:
setFlushMode in interface EntityManager

setExtended

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


lock

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

Specified by:
lock in interface EntityManager

clear

public void clear()
Clears the manager.

Specified by:
clear in interface EntityManager

flush

public void flush()
Synchronize with the database.

Specified by:
flush in interface EntityManager

joinTransaction

public void joinTransaction()
Joins the transaction.

Specified by:
joinTransaction in interface EntityManager

getDelegate

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

Specified by:
getDelegate in interface EntityManager

close

public void close()
Clears the manager.

Specified by:
close in interface EntityManager

createQuery

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

Specified by:
createQuery in interface EntityManager

createNamedQuery

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

Specified by:
createNamedQuery in interface EntityManager

createNativeQuery

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

Specified by:
createNativeQuery in interface EntityManager

createNativeQuery

public Query createNativeQuery(java.lang.String sql,
                               java.lang.String map)
Creates a query.

Specified by:
createNativeQuery in interface EntityManager

createNativeQuery

public Query createNativeQuery(java.lang.String sql,
                               java.lang.Class retType)
Creates a query.

Specified by:
createNativeQuery in interface EntityManager

refresh

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

Specified by:
refresh in interface EntityManager

contains

public boolean contains(java.lang.Object entity)
Returns true if the entity belongs to the current context.

Specified by:
contains in interface EntityManager

getTransaction

public EntityTransaction getTransaction()
Returns the entity manager transaction.

Specified by:
getTransaction in interface EntityManager

isOpen

public boolean isOpen()
Returns true if open.

Specified by:
isOpen in interface EntityManager

toString

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

createNamedQuery

public <T> TypedQuery<T> createNamedQuery(java.lang.String name,
                                          java.lang.Class<T> resultClass)
Description copied from interface: EntityManager
Creates a named query.

Specified by:
createNamedQuery in interface EntityManager

createQuery

public <T> TypedQuery<T> createQuery(CriteriaQuery<T> criteriaQuery)
Description copied from interface: EntityManager
Creates a TypedQuery for a criteria

Specified by:
createQuery in interface EntityManager

createQuery

public <T> TypedQuery<T> createQuery(java.lang.String qlString,
                                     java.lang.Class<T> resultClass)
Description copied from interface: EntityManager
Creates a TypedQuery for a criteria

Specified by:
createQuery in interface EntityManager

detach

public void detach(java.lang.Object entity)
Description copied from interface: EntityManager
Clears the entity

Specified by:
detach in interface EntityManager

find

public <T> T find(java.lang.Class<T> entityCLass,
                  java.lang.Object primaryKey,
                  java.util.Map<java.lang.String,java.lang.Object> properties)
Description copied from interface: EntityManager
Find based on the primary key.

Specified by:
find in interface EntityManager

find

public <T> T find(java.lang.Class<T> entityCLass,
                  java.lang.Object primaryKey,
                  LockModeType lockMode)
Description copied from interface: EntityManager
Find based on the primary key.

Specified by:
find in interface EntityManager

find

public <T> T find(java.lang.Class<T> entityCLass,
                  java.lang.Object primaryKey,
                  LockModeType lockMode,
                  java.util.Map<java.lang.String,java.lang.Object> properties)
Description copied from interface: EntityManager
Find based on the primary key.

Specified by:
find in interface EntityManager

getCriteriaBuilder

public CriteriaBuilder getCriteriaBuilder()
Description copied from interface: EntityManager
Returns a CriteriaBuilder to create CriteriaQuery objects.

Specified by:
getCriteriaBuilder in interface EntityManager

getEntityManagerFactory

public EntityManagerFactory getEntityManagerFactory()
Description copied from interface: EntityManager
Returns the owning factory

Specified by:
getEntityManagerFactory in interface EntityManager

getLockMode

public LockModeType getLockMode(java.lang.Object entity)
Description copied from interface: EntityManager
Returns the lock mode for the entity

Specified by:
getLockMode in interface EntityManager

getMetamodel

public Metamodel getMetamodel()
Description copied from interface: EntityManager
Returns the Metamodel interface for the persistence unit.

Specified by:
getMetamodel in interface EntityManager

getProperties

public java.util.Map<java.lang.String,java.lang.Object> getProperties()
Description copied from interface: EntityManager
Returns the properties for the entity manager

Specified by:
getProperties in interface EntityManager

lock

public void lock(java.lang.Object entity,
                 LockModeType lockMode,
                 java.util.Map<java.lang.String,java.lang.Object> properties)
Description copied from interface: EntityManager
Sets the lock mode for an entity.

Specified by:
lock in interface EntityManager

refresh

public void refresh(java.lang.Object entity,
                    java.util.Map<java.lang.String,java.lang.Object> properties)
Description copied from interface: EntityManager
Update the state of the instance from the database.

Specified by:
refresh in interface EntityManager

refresh

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

Specified by:
refresh in interface EntityManager

refresh

public void refresh(java.lang.Object entity,
                    LockModeType lockMode,
                    java.util.Map<java.lang.String,java.lang.Object> properties)
Description copied from interface: EntityManager
Update the state of the instance from the database.

Specified by:
refresh in interface EntityManager

setProperty

public void setProperty(java.lang.String propertyName,
                        java.lang.Object value)
Description copied from interface: EntityManager
Sets properties for the entity manager

Specified by:
setProperty in interface EntityManager

unwrap

public <T> T unwrap(java.lang.Class<T> cls)
Description copied from interface: EntityManager
Returns the object of the type for a provider-specific API

Specified by:
unwrap in interface EntityManager