Spring Data Couchbase

org.springframework.data.couchbase.core.mapping.event
Class ValidatingCouchbaseEventListener

java.lang.Object
  extended by org.springframework.data.couchbase.core.mapping.event.AbstractCouchbaseEventListener<Object>
      extended by org.springframework.data.couchbase.core.mapping.event.ValidatingCouchbaseEventListener
All Implemented Interfaces:
EventListener, ApplicationListener<CouchbaseMappingEvent<?>>

public class ValidatingCouchbaseEventListener
extends AbstractCouchbaseEventListener<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, Michael Nitschinger

Constructor Summary
ValidatingCouchbaseEventListener(javax.validation.Validator validator)
          Creates a new ValidatingCouchbaseEventListener using the given Validator.
 
Method Summary
 void onBeforeSave(Object source, CouchbaseDocument dbo)
           
 
Methods inherited from class org.springframework.data.couchbase.core.mapping.event.AbstractCouchbaseEventListener
onAfterDelete, onAfterSave, onApplicationEvent, onBeforeConvert, onBeforeDelete
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidatingCouchbaseEventListener

public ValidatingCouchbaseEventListener(javax.validation.Validator validator)
Creates a new ValidatingCouchbaseEventListener using the given Validator.

Parameters:
validator - must not be null.
Method Detail

onBeforeSave

public void onBeforeSave(Object source,
                         CouchbaseDocument dbo)
Overrides:
onBeforeSave in class AbstractCouchbaseEventListener<Object>

Spring Data Couchbase

Copyright © 2011-2014–2014 Pivotal Software, Inc.. All rights reserved.