@FunctionalInterface public interface BeforeSaveCallback<T> extends EntityCallback<T>
EntityCallbacks| Modifier and Type | Method and Description |
|---|---|
T |
onBeforeSave(T entity,
org.bson.Document document,
String collection)
Entity callback method invoked before a domain object is saved.
|
T onBeforeSave(T entity, org.bson.Document document, String collection)
Document contents. This method is called after converting the
entity to a Document so effectively the document is used as outcome of invoking this callback.
Changes to the domain object are not taken into account for saving, only changes to the document. Only transient
fields of the entity should be changed in this callback. To change persistent the entity before being converted,
use the BeforeConvertCallback.entity - the domain object to save.document - Document representing the entity.collection - name of the collection.Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.