Groovy Documentation

org.codehaus.groovy.grails.orm.hibernate.support
[Java] Class ClosureEventTriggeringInterceptor

java.lang.Object
  org.hibernate.event.def.AbstractReassociateEventListener
      org.hibernate.event.def.AbstractSaveEventListener
          org.hibernate.event.def.DefaultSaveOrUpdateEventListener
              org.codehaus.groovy.grails.orm.hibernate.events.SaveOrUpdateEventListener
                  org.codehaus.groovy.grails.orm.hibernate.support.ClosureEventTriggeringInterceptor
All Implemented Interfaces:
org.springframework.context.ApplicationContextAware, org.hibernate.event.PreLoadEventListener, org.hibernate.event.PostLoadEventListener, org.hibernate.event.PostInsertEventListener, org.hibernate.event.PostUpdateEventListener, org.hibernate.event.PostDeleteEventListener, org.hibernate.event.PreDeleteEventListener, org.hibernate.event.PreUpdateEventListener, org.hibernate.event.PreInsertEventListener

public class ClosureEventTriggeringInterceptor
extends SaveOrUpdateEventListener

Listens for Hibernate events and publishes corresponding Datastore events.

Authors:
Graeme Rocher
Lari Hotari
Burt Beckwith
Since:
1.0


Field Summary
static java.lang.String AFTER_DELETE_EVENT

static java.lang.String AFTER_INSERT_EVENT

static java.lang.String AFTER_LOAD_EVENT

static java.lang.String AFTER_UPDATE_EVENT

static java.lang.String BEFORE_DELETE_EVENT

static java.lang.String BEFORE_INSERT_EVENT

static java.lang.String BEFORE_LOAD_EVENT

static java.lang.String BEFORE_UPDATE_EVENT

static java.util.Collection IGNORED

static java.lang.String ONLOAD_EVENT

static java.lang.String ONLOAD_SAVE

 
Constructor Summary
ClosureEventTriggeringInterceptor()

 
Method Summary
static void addNullabilityCheckerPreInsertEventListener(org.hibernate.event.EventListeners listenerRegistry)

protected java.lang.Boolean getAssumedUnsaved()

static void markInsertActive()

Clears the ThreadLocal variable set by markInsertActive().

void onPostDelete(org.hibernate.event.PostDeleteEvent hibernateEvent)

void onPostInsert(org.hibernate.event.PostInsertEvent hibernateEvent)

void onPostLoad(org.hibernate.event.PostLoadEvent hibernateEvent)

void onPostUpdate(org.hibernate.event.PostUpdateEvent hibernateEvent)

boolean onPreDelete(org.hibernate.event.PreDeleteEvent hibernateEvent)

boolean onPreInsert(org.hibernate.event.PreInsertEvent hibernateEvent)

void onPreLoad(org.hibernate.event.PreLoadEvent hibernateEvent)

boolean onPreUpdate(org.hibernate.event.PreUpdateEvent hibernateEvent)

void onSaveOrUpdate(org.hibernate.event.SaveOrUpdateEvent hibernateEvent)

protected java.io.Serializable performSaveOrReplicate(java.lang.Object entity, org.hibernate.engine.EntityKey key, org.hibernate.persister.entity.EntityPersister persister, boolean useIdentityColumn, java.lang.Object anything, org.hibernate.event.EventSource source, boolean requiresImmediateIdAccess)

static void resetInsertActive()

void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)

void setDatastores(java.util.Map datastores)

 
Methods inherited from class org.hibernate.event.def.DefaultSaveOrUpdateEventListener
org.hibernate.event.def.DefaultSaveOrUpdateEventListener#onSaveOrUpdate(org.hibernate.event.SaveOrUpdateEvent), org.hibernate.event.def.DefaultSaveOrUpdateEventListener#wait(), org.hibernate.event.def.DefaultSaveOrUpdateEventListener#wait(long, int), org.hibernate.event.def.DefaultSaveOrUpdateEventListener#wait(long), org.hibernate.event.def.DefaultSaveOrUpdateEventListener#equals(java.lang.Object), org.hibernate.event.def.DefaultSaveOrUpdateEventListener#toString(), org.hibernate.event.def.DefaultSaveOrUpdateEventListener#hashCode(), org.hibernate.event.def.DefaultSaveOrUpdateEventListener#getClass(), org.hibernate.event.def.DefaultSaveOrUpdateEventListener#notify(), org.hibernate.event.def.DefaultSaveOrUpdateEventListener#notifyAll()
 

Field Detail

AFTER_DELETE_EVENT

public static final java.lang.String AFTER_DELETE_EVENT


AFTER_INSERT_EVENT

public static final java.lang.String AFTER_INSERT_EVENT


AFTER_LOAD_EVENT

public static final java.lang.String AFTER_LOAD_EVENT


AFTER_UPDATE_EVENT

public static final java.lang.String AFTER_UPDATE_EVENT


BEFORE_DELETE_EVENT

public static final java.lang.String BEFORE_DELETE_EVENT


BEFORE_INSERT_EVENT

public static final java.lang.String BEFORE_INSERT_EVENT


BEFORE_LOAD_EVENT

public static final java.lang.String BEFORE_LOAD_EVENT


BEFORE_UPDATE_EVENT

public static final java.lang.String BEFORE_UPDATE_EVENT


IGNORED

public static final java.util.Collection IGNORED


ONLOAD_EVENT

public static final java.lang.String ONLOAD_EVENT


ONLOAD_SAVE

public static final java.lang.String ONLOAD_SAVE


 
Constructor Detail

ClosureEventTriggeringInterceptor

public ClosureEventTriggeringInterceptor()


 
Method Detail

addNullabilityCheckerPreInsertEventListener

public static final void addNullabilityCheckerPreInsertEventListener(org.hibernate.event.EventListeners listenerRegistry)


getAssumedUnsaved

*/
protected java.lang.Boolean getAssumedUnsaved()


markInsertActive

public static void markInsertActive()
Clears the ThreadLocal variable set by markInsertActive().


onPostDelete

public void onPostDelete(org.hibernate.event.PostDeleteEvent hibernateEvent)


onPostInsert

public void onPostInsert(org.hibernate.event.PostInsertEvent hibernateEvent)


onPostLoad

public void onPostLoad(org.hibernate.event.PostLoadEvent hibernateEvent)


onPostUpdate

public void onPostUpdate(org.hibernate.event.PostUpdateEvent hibernateEvent)


onPreDelete

public boolean onPreDelete(org.hibernate.event.PreDeleteEvent hibernateEvent)


onPreInsert

public boolean onPreInsert(org.hibernate.event.PreInsertEvent hibernateEvent)


onPreLoad

public void onPreLoad(org.hibernate.event.PreLoadEvent hibernateEvent)


onPreUpdate

public boolean onPreUpdate(org.hibernate.event.PreUpdateEvent hibernateEvent)


onSaveOrUpdate

public void onSaveOrUpdate(SaveOrUpdateEvent hibernateEvent) throws HibernateException {
public void onSaveOrUpdate(org.hibernate.event.SaveOrUpdateEvent hibernateEvent)


performSaveOrReplicate

validate(entity, persister, source);
protected java.io.Serializable performSaveOrReplicate(java.lang.Object entity, org.hibernate.engine.EntityKey key, org.hibernate.persister.entity.EntityPersister persister, boolean useIdentityColumn, java.lang.Object anything, org.hibernate.event.EventSource source, boolean requiresImmediateIdAccess)


resetInsertActive

public static void resetInsertActive()


setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)


setDatastores

public void setDatastores(java.util.Map datastores)


 

Groovy Documentation