org.granite.tide.hibernate
Class HibernatePersistenceAdapter
java.lang.Object
org.granite.tide.hibernate.HibernatePersistenceAdapter
- All Implemented Interfaces:
- TidePersistenceAdapter
public class HibernatePersistenceAdapter
- extends Object
- implements TidePersistenceAdapter
Implementation of Tide persistence adapter with a Hibernate Session
- Author:
- William DRAI
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HibernatePersistenceAdapter
public HibernatePersistenceAdapter(SessionFactory sessionFactory)
HibernatePersistenceAdapter
public HibernatePersistenceAdapter(Session session)
find
public Object find(Class<?> entityClass,
Serializable id)
- Find an entity in the persistence context
- Specified by:
find in interface TidePersistenceAdapter
- Parameters:
entityClass - class of the looked up entityid - entity identifier
- Returns:
- the entity with the persistence context.
throwOptimisticLockException
public void throwOptimisticLockException(Object entity)
- Throw an optimistic locking error
- Specified by:
throwOptimisticLockException in interface TidePersistenceAdapter
- Parameters:
entity - entity instance loaded from the database