org.springframework.data.mongodb.core.mapping.event
Class ValidatingMongoEventListener
java.lang.Object
org.springframework.data.mongodb.core.mapping.event.AbstractMongoEventListener<Object>
org.springframework.data.mongodb.core.mapping.event.ValidatingMongoEventListener
- All Implemented Interfaces:
- EventListener, ApplicationListener<MongoMappingEvent<?>>
public class ValidatingMongoEventListener
- extends AbstractMongoEventListener<Object>
javax.validation dependant entities validator. When it is registered as Spring component its automatically invoked
before entities are saved in database.
- Author:
- Maciej Walkowiak
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ValidatingMongoEventListener
public ValidatingMongoEventListener(javax.validation.Validator validator)
- Creates a new
ValidatingMongoEventListener
using the given Validator
.
- Parameters:
validator
- must not be null.
onBeforeSave
public void onBeforeSave(Object source,
DBObject dbo)
- Overrides:
onBeforeSave
in class AbstractMongoEventListener<Object>
Copyright © 2012. All Rights Reserved.