Class AuditingEntityCallback
java.lang.Object
org.springframework.data.elasticsearch.core.event.AuditingEntityCallback
- All Implemented Interfaces:
Ordered, BeforeConvertCallback<Object>, EntityCallback<Object>
public class AuditingEntityCallback
extends Object
implements BeforeConvertCallback<Object>, Ordered
EntityCallback to populate auditing related fields on an entity about to be saved.- Since:
- 4.0
- Author:
- Peter-Josef Meisch, Roman Puchkovskiy
-
Field Summary
Fields inherited from interface Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionAuditingEntityCallback(ObjectFactory<IsNewAwareAuditingHandler> auditingHandlerFactory) Creates a newAuditingEntityCallbackusing the givenIsNewAwareAuditingHandlerprovided by the givenObjectFactory. -
Method Summary
Modifier and TypeMethodDescriptionintgetOrder()onBeforeConvert(Object entity, IndexCoordinates index) Callback method that will be invoked before an entity is persisted.
-
Constructor Details
-
AuditingEntityCallback
Creates a newAuditingEntityCallbackusing the givenIsNewAwareAuditingHandlerprovided by the givenObjectFactory.- Parameters:
auditingHandlerFactory- must not be null.
-
-
Method Details
-
onBeforeConvert
Description copied from interface:BeforeConvertCallbackCallback method that will be invoked before an entity is persisted. Can return the same or a different instance of the domain entity class.- Specified by:
onBeforeConvertin interfaceBeforeConvertCallback<Object>- Parameters:
entity- the entity being convertedindex- must not be null.- Returns:
- the entity to be converted
-
getOrder
-