org.springframework.datastore.validation
Class ValidatingInterceptor
java.lang.Object
org.springframework.datastore.engine.EmptyInterceptor
org.springframework.datastore.validation.ValidatingInterceptor
- All Implemented Interfaces:
- DatastoreAware, EntityInterceptor
public class ValidatingInterceptor
- extends EmptyInterceptor
An EntityInterceptor that uses
Spring's validation mechanism to evict objects if an error occurs
- Since:
- 1.0
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ValidatingInterceptor
public ValidatingInterceptor()
beforeInsert
public boolean beforeInsert(PersistentEntity entity,
EntityAccess e)
- 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 entitye - The object
- Returns:
- False if the operation should be cancelled
beforeUpdate
public boolean beforeUpdate(PersistentEntity entity,
EntityAccess e)
- 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 entitye - The object
- Returns:
- False if the operation should be cancelled
onErrors
protected void onErrors(Object object,
org.springframework.validation.Errors errors)
- Sub classes should override to receive error notifications
- Parameters:
object - The object being validatederrors - The errors instance