org.granite.tide.data
Class JPAPersistenceAdapter
java.lang.Object
org.granite.tide.data.JPAPersistenceAdapter
- All Implemented Interfaces:
- TidePersistenceAdapter
public class JPAPersistenceAdapter
- extends Object
- implements TidePersistenceAdapter
Implementation of Tide persistence adapter with a JPA EntityManager
- Author:
- William DRAI
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
entityManager
protected EntityManager entityManager
JPAPersistenceAdapter
public JPAPersistenceAdapter(EntityManager entityManager)
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