org.grails.datastore.gorm.events
Class DomainEventInterceptor

java.lang.Object
  extended by org.springframework.datastore.engine.EmptyInterceptor
      extended by org.grails.datastore.gorm.events.DomainEventInterceptor
All Implemented Interfaces:
DatastoreAware, EntityInterceptor

public class DomainEventInterceptor
extends EmptyInterceptor

An interceptor that provides support for GORM domain events

Since:
1.0

Field Summary
static String EVENT_BEFORE_INSERT
           
static Class[] ZERO_PARAMS
           
 
Fields inherited from class org.springframework.datastore.engine.EmptyInterceptor
datastore
 
Constructor Summary
DomainEventInterceptor()
           
 
Method Summary
 boolean beforeDelete(PersistentEntity entity, EntityAccess ea)
          Called before an entity is deleted
 boolean beforeInsert(PersistentEntity entity, EntityAccess ea)
          Called before an entity is inserted
 boolean beforeUpdate(PersistentEntity entity, EntityAccess ea)
          Called before an entity is updated
 void setDatastore(Datastore datastore)
          Sets the datastore on this instance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ZERO_PARAMS

public static final Class[] ZERO_PARAMS

EVENT_BEFORE_INSERT

public static final String EVENT_BEFORE_INSERT
See Also:
Constant Field Values
Constructor Detail

DomainEventInterceptor

public DomainEventInterceptor()
Method Detail

beforeInsert

public boolean beforeInsert(PersistentEntity entity,
                            EntityAccess ea)
Description copied from interface: EntityInterceptor
Called before an entity is inserted

Specified by:
beforeInsert in interface EntityInterceptor
Overrides:
beforeInsert in class EmptyInterceptor
Parameters:
entity - The entity
ea - The object
Returns:
False if the operation should be cancelled

beforeUpdate

public boolean beforeUpdate(PersistentEntity entity,
                            EntityAccess ea)
Description copied from interface: EntityInterceptor
Called before an entity is updated

Specified by:
beforeUpdate in interface EntityInterceptor
Overrides:
beforeUpdate in class EmptyInterceptor
Parameters:
entity - The entity
ea - The object
Returns:
False if the operation should be cancelled

beforeDelete

public boolean beforeDelete(PersistentEntity entity,
                            EntityAccess ea)
Description copied from interface: EntityInterceptor
Called before an entity is deleted

Specified by:
beforeDelete in interface EntityInterceptor
Overrides:
beforeDelete in class EmptyInterceptor
Parameters:
entity - The entity
ea - The object
Returns:
False if the operation should be cancelled

setDatastore

public void setDatastore(Datastore datastore)
Description copied from interface: DatastoreAware
Sets the datastore on this instance

Specified by:
setDatastore in interface DatastoreAware
Overrides:
setDatastore in class EmptyInterceptor
Parameters:
datastore - The datastore