org.compass.gps.device.jpa
Class AbstractCompassJpaEntityListener

java.lang.Object
  extended by org.compass.gps.device.jpa.AbstractCompassJpaEntityListener
Direct Known Subclasses:
AbstractDeviceJpaEntityListener

public abstract class AbstractCompassJpaEntityListener
extends Object

An abstract support class for event lifecycle JPA spec support. Requires the Compass instance to be provided (usual sub classes will simple fetch it from the Jndi location). This is the least prefereable way to use lifecycle event listerens, please see JpaGpsDevice and JpaEntityLifecycleInjector.

Author:
kimchy

Field Summary
protected  org.apache.commons.logging.Log log
           
 
Constructor Summary
AbstractCompassJpaEntityListener()
           
 
Method Summary
protected  boolean disable()
           
protected abstract  Compass getCompass()
           
protected  boolean hasMappingForEntity(Class clazz, Cascade cascade)
           
protected  boolean hasMappingForEntity(String name, Cascade cascade)
           
 void postPersist(Object entity)
           
 void postRemove(Object entity)
           
 void postUpdate(Object entity)
           
protected  boolean throwExceptionOnError()
          Should exception be thrown during the mirroring operation, or just logged.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected org.apache.commons.logging.Log log
Constructor Detail

AbstractCompassJpaEntityListener

public AbstractCompassJpaEntityListener()
Method Detail

getCompass

protected abstract Compass getCompass()

throwExceptionOnError

protected boolean throwExceptionOnError()
Should exception be thrown during the mirroring operation, or just logged. Defaults to true.


disable

protected boolean disable()

hasMappingForEntity

protected boolean hasMappingForEntity(Class clazz,
                                      Cascade cascade)

hasMappingForEntity

protected boolean hasMappingForEntity(String name,
                                      Cascade cascade)

postPersist

public void postPersist(Object entity)
                 throws CompassException
Throws:
CompassException

postUpdate

public void postUpdate(Object entity)
                throws CompassException
Throws:
CompassException

postRemove

public void postRemove(Object entity)
                throws CompassException
Throws:
CompassException


Copyright (c) 2004-2009 The Compass Project.