|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.compass.gps.device.jpa.AbstractEntityManagerWrapper
public abstract class AbstractEntityManagerWrapper
A simple base class for EntityManagerWrapper implementations. Calls the subclasses
for EntityManager, and an optioan EntityTransaction. Takes care of
all the rest.
| Field Summary | |
|---|---|
protected javax.persistence.EntityManager |
entityManager
|
protected javax.persistence.EntityManagerFactory |
entityManagerFactory
|
protected javax.persistence.EntityTransaction |
entityTransaction
|
protected org.apache.commons.logging.Log |
log
|
| Constructor Summary | |
|---|---|
AbstractEntityManagerWrapper()
|
|
| Method Summary | |
|---|---|
void |
close()
Closes the current EntityManager, commiting the transaction if necessary. |
void |
closeOnError()
Closes the current EntityManager, rollback the transaction if necessary. |
protected abstract javax.persistence.EntityManager |
doGetEntityManager()
|
protected abstract javax.persistence.EntityTransaction |
doGetEntityTransaction()
|
javax.persistence.EntityManager |
getEntityManager()
Returns the EntityManager opened by the wrapper open operation. |
void |
open()
Opens the warpper for a session of reading enteties for indexing. |
void |
setUp(javax.persistence.EntityManagerFactory entityManagerFactory)
Sets up the entity manager wrapper with the EntityManagerFactory. |
protected abstract boolean |
shouldCloseEntityManager()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected org.apache.commons.logging.Log log
protected javax.persistence.EntityManagerFactory entityManagerFactory
protected javax.persistence.EntityManager entityManager
protected javax.persistence.EntityTransaction entityTransaction
| Constructor Detail |
|---|
public AbstractEntityManagerWrapper()
| Method Detail |
|---|
public void setUp(javax.persistence.EntityManagerFactory entityManagerFactory)
EntityManagerWrapperEntityManagerFactory.
setUp in interface EntityManagerWrapperentityManagerFactory - The EntityManagerFactory the wrapper will usepublic javax.persistence.EntityManager getEntityManager()
EntityManagerWrapperEntityManager opened by the wrapper open operation.
getEntityManager in interface EntityManagerWrapperEntityManager
public void open()
throws JpaGpsDeviceException
EntityManagerWrapper
open in interface EntityManagerWrapperJpaGpsDeviceException
public void close()
throws JpaGpsDeviceException
EntityManagerWrapperEntityManager, commiting the transaction if necessary.
close in interface EntityManagerWrapperJpaGpsDeviceException
public void closeOnError()
throws JpaGpsDeviceException
EntityManagerWrapperEntityManager, rollback the transaction if necessary.
closeOnError in interface EntityManagerWrapperJpaGpsDeviceException
protected abstract javax.persistence.EntityManager doGetEntityManager()
throws javax.persistence.PersistenceException
javax.persistence.PersistenceException
protected abstract javax.persistence.EntityTransaction doGetEntityTransaction()
throws javax.persistence.PersistenceException
javax.persistence.PersistenceExceptionprotected abstract boolean shouldCloseEntityManager()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||