public class AuditingEntityCallback extends Object implements BeforeConvertCallback<Object>, AfterConvertCallback<Object>, Ordered
EntityCallback
to populate auditing related fields on an entity about to be saved.HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor and Description |
---|
AuditingEntityCallback(ObjectFactory<IsNewAwareAuditingHandler> auditingHandlerFactory)
Creates a new
AuditingEntityCallback using the given MappingContext and AuditingHandler
provided by the given ObjectFactory . |
Modifier and Type | Method and Description |
---|---|
int |
getOrder() |
Object |
onAfterConvert(Object entity,
CouchbaseDocument document,
String collection)
Entity callback method invoked after a domain object is materialized from a
CouchbaseDocument . |
Object |
onBeforeConvert(Object entity,
String collection)
Entity callback method invoked before a domain object is converted to be persisted.
|
public AuditingEntityCallback(ObjectFactory<IsNewAwareAuditingHandler> auditingHandlerFactory)
AuditingEntityCallback
using the given MappingContext
and AuditingHandler
provided by the given ObjectFactory
.auditingHandlerFactory
- must not be null.public Object onBeforeConvert(Object entity, String collection)
BeforeConvertCallback
onBeforeConvert
in interface BeforeConvertCallback<Object>
entity
- the domain object to save.collection
- name of the collection.public Object onAfterConvert(Object entity, CouchbaseDocument document, String collection)
AfterConvertCallback
CouchbaseDocument
. Can return
either the same or a modified instance of the domain object.onAfterConvert
in interface AfterConvertCallback<Object>
entity
- the domain object (the result of the conversion).document
- must not be null.collection
- name of the collection.CouchbaseDocument
.Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.