org.loom.persistence
Class HibernateExtendedEntityManagerImpl

java.lang.Object
  extended by org.loom.persistence.AbstractExtendedEntityManager
      extended by org.loom.persistence.HibernateExtendedEntityManagerImpl
All Implemented Interfaces:
javax.persistence.EntityManager, org.hibernate.ejb.HibernateEntityManager, ExtendedEntityManager, HibernateExtendedEntityManager

public class HibernateExtendedEntityManagerImpl
extends AbstractExtendedEntityManager
implements HibernateExtendedEntityManager

Extended entity manager operations for the Hibernate JPA Implementation.


Constructor Summary
HibernateExtendedEntityManagerImpl(javax.persistence.EntityManager entityManager)
           
 
Method Summary
 void evict(java.lang.Object o)
          Remove this instance from the session cache.
 java.lang.String getIdPropertyName(java.lang.Class<?> clazz)
           
 org.hibernate.Session getSession()
           
 java.lang.String getVersionPropertyName(java.lang.Class<?> clazz)
           
<T> T
getVersionValue(java.lang.Object o)
           
 void setReadOnly(java.lang.Object instance, boolean readOnly)
          Sets an instance to readOnly.
 
Methods inherited from class org.loom.persistence.AbstractExtendedEntityManager
clear, close, contains, createNamedQuery, createNativeQuery, createNativeQuery, createNativeQuery, createQuery, find, find, findAll, findNamed, findNamedSingle, findSingle, flush, getDelegate, getEntityManager, getFlushMode, getReference, getTransaction, isOpen, joinTransaction, lock, merge, persist, query, refresh, remove, remove, setFlushMode, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.loom.persistence.ExtendedEntityManager
find, find, findAll, findNamed, findNamedSingle, findSingle, query, remove, update
 
Methods inherited from interface javax.persistence.EntityManager
clear, close, contains, createNamedQuery, createNativeQuery, createNativeQuery, createNativeQuery, createQuery, flush, getDelegate, getFlushMode, getReference, getTransaction, isOpen, joinTransaction, lock, merge, persist, refresh, remove, setFlushMode
 

Constructor Detail

HibernateExtendedEntityManagerImpl

public HibernateExtendedEntityManagerImpl(javax.persistence.EntityManager entityManager)
Method Detail

getIdPropertyName

public java.lang.String getIdPropertyName(java.lang.Class<?> clazz)
Specified by:
getIdPropertyName in interface ExtendedEntityManager
Parameters:
clazz - the persistent class
Returns:
the name of the id property of a persistent class

getVersionPropertyName

public java.lang.String getVersionPropertyName(java.lang.Class<?> clazz)
Specified by:
getVersionPropertyName in interface ExtendedEntityManager
Parameters:
clazz - the persistent class
Returns:
the version property name of a persistent class if it has defined one, null otherwise

getVersionValue

public <T> T getVersionValue(java.lang.Object o)
Specified by:
getVersionValue in interface ExtendedEntityManager
Parameters:
o - the persistent entity to inspect
Returns:
the version value of a persistent instance, or null if not versioned

evict

public void evict(java.lang.Object o)
Description copied from interface: ExtendedEntityManager
Remove this instance from the session cache. Changes to the instance will not be synchronized with the database.

Specified by:
evict in interface ExtendedEntityManager
Parameters:
o - a persistent instance

setReadOnly

public void setReadOnly(java.lang.Object instance,
                        boolean readOnly)
Description copied from interface: ExtendedEntityManager
Sets an instance to readOnly. ReadOnly instances do not write any changes to the database when flushing.

Specified by:
setReadOnly in interface ExtendedEntityManager
Parameters:
instance - a persistent instance
readOnly - true to set the entity to readOnly

getSession

public org.hibernate.Session getSession()
Specified by:
getSession in interface org.hibernate.ejb.HibernateEntityManager