org.compass.gps.device.jpa
Class DefaultEntityManagerWrapper

java.lang.Object
  extended by org.compass.gps.device.jpa.AbstractEntityManagerWrapper
      extended by org.compass.gps.device.jpa.DefaultEntityManagerWrapper
All Implemented Interfaces:
EntityManagerWrapper

public class DefaultEntityManagerWrapper
extends AbstractEntityManagerWrapper

The default EntityManagerWrapper implementation. Works well both in JTA and Resource Local JPA transactions.

Author:
kimchy

Field Summary
 
Fields inherited from class org.compass.gps.device.jpa.AbstractEntityManagerWrapper
entityManager, entityManagerFactory, log
 
Constructor Summary
DefaultEntityManagerWrapper()
           
 
Method Summary
protected  void beginTransaction()
           
protected  void commitTransaction()
           
protected  void rollbackTransaction()
           
protected  boolean shouldCloseEntityManager()
           
 
Methods inherited from class org.compass.gps.device.jpa.AbstractEntityManagerWrapper
close, closeOnError, doCreateEntityManager, getEntityManager, newInstance, open, setUp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultEntityManagerWrapper

public DefaultEntityManagerWrapper()
Method Detail

beginTransaction

protected void beginTransaction()
                         throws javax.persistence.PersistenceException
Specified by:
beginTransaction in class AbstractEntityManagerWrapper
Throws:
javax.persistence.PersistenceException

commitTransaction

protected void commitTransaction()
                          throws javax.persistence.PersistenceException
Specified by:
commitTransaction in class AbstractEntityManagerWrapper
Throws:
javax.persistence.PersistenceException

rollbackTransaction

protected void rollbackTransaction()
                            throws javax.persistence.PersistenceException
Specified by:
rollbackTransaction in class AbstractEntityManagerWrapper
Throws:
javax.persistence.PersistenceException

shouldCloseEntityManager

protected boolean shouldCloseEntityManager()
Specified by:
shouldCloseEntityManager in class AbstractEntityManagerWrapper


Copyright (c) 2004-2008 The Compass Project.