org.grails.datastore.gorm.events
Class AutoTimestampInterceptor
java.lang.Object
org.springframework.datastore.engine.EmptyInterceptor
org.grails.datastore.gorm.events.AutoTimestampInterceptor
- All Implemented Interfaces:
- DatastoreAware, EntityInterceptor, MappingContext.Listener
public class AutoTimestampInterceptor
- extends EmptyInterceptor
- implements MappingContext.Listener
An interceptor that adds support for GORM-style auto-timestamping
- Since:
- 1.0
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DATE_CREATED_PROPERTY
public static final String DATE_CREATED_PROPERTY
- See Also:
- Constant Field Values
LAST_UPDATED_PROPERTY
public static final String LAST_UPDATED_PROPERTY
- See Also:
- Constant Field Values
AutoTimestampInterceptor
public AutoTimestampInterceptor()
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 entityea
- 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 entityea
- 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
persistentEntityAdded
public void persistentEntityAdded(PersistentEntity entity)
- Description copied from interface:
MappingContext.Listener
- Fired when a new entity is added
- Specified by:
persistentEntityAdded
in interface MappingContext.Listener
- Parameters:
entity
- The entity