Class AuditingBeforeBindCallback
java.lang.Object
org.springframework.data.neo4j.core.mapping.callback.AuditingBeforeBindCallback
- All Implemented Interfaces:
Ordered
,EntityCallback<Object>
,BeforeBindCallback<Object>
@API(status=STABLE,
since="6.0.2")
public final class AuditingBeforeBindCallback
extends Object
implements BeforeBindCallback<Object>, Ordered
EntityCallback
to populate auditing related fields on an entity about to be bound to a record.- Since:
- 6.0.2
- Author:
- Michael J. Simons
-
Field Summary
FieldsFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ConstructorsConstructorDescriptionAuditingBeforeBindCallback
(ObjectFactory<IsNewAwareAuditingHandler> auditingHandlerFactory) Creates a newAuditingBeforeBindCallback
using the givenAuditingHandler
provided by the givenObjectFactory
. -
Method Summary
Modifier and TypeMethodDescriptionint
getOrder()
onBeforeBind
(Object entity) Entity callback method invoked before a domain object is saved.
-
Field Details
-
NEO4J_AUDITING_ORDER
public static final int NEO4J_AUDITING_ORDER- See Also:
-
-
Constructor Details
-
AuditingBeforeBindCallback
Creates a newAuditingBeforeBindCallback
using the givenAuditingHandler
provided by the givenObjectFactory
.- Parameters:
auditingHandlerFactory
- must not be null.
-
-
Method Details
-
onBeforeBind
Description copied from interface:BeforeBindCallback
Entity callback method invoked before a domain object is saved. Can return either the same or a modified instance of the domain object. This method is called before converting theentity
to aMap
, so the outcome of this callback is used to create the record for the domain object.- Specified by:
onBeforeBind
in interfaceBeforeBindCallback<Object>
- Parameters:
entity
- the domain object to save.- Returns:
- the domain object to be persisted.
-
getOrder
public int getOrder()
-