Interface ReactiveBeforeSaveCallback<T>

All Superinterfaces:
EntityCallback<T>
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ReactiveBeforeSaveCallback<T> extends EntityCallback<T>
Entity callback triggered before save of a document.
Since:
2.2
Author:
Mark Paluch
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    org.reactivestreams.Publisher<T>
    onBeforeSave(T entity, org.bson.Document document, String collection)
    Entity callback method invoked before a domain object is saved.
  • Method Details

    • onBeforeSave

      org.reactivestreams.Publisher<T> onBeforeSave(T entity, org.bson.Document document, String collection)
      Entity callback method invoked before a domain object is saved. Can return either the same or a modified instance of the domain object and can modify Document contents. This method is called after converting the entity to Document so effectively the document is used as outcome of invoking this callback.
      Parameters:
      entity - the domain object to save.
      document - Document representing the entity.
      collection - name of the collection.
      Returns:
      a Publisher emitting the domain object to be persisted.