Class RelationalAuditingCallback
java.lang.Object
org.springframework.data.relational.auditing.RelationalAuditingCallback
- All Implemented Interfaces:
org.springframework.core.Ordered
,org.springframework.data.mapping.callback.EntityCallback<Object>
,BeforeConvertCallback<Object>
public class RelationalAuditingCallback
extends Object
implements BeforeConvertCallback<Object>, org.springframework.core.Ordered
BeforeConvertCallback
to capture auditing information on persisting and updating entities.
An instance of this class gets registered when you enable auditing for Spring Data Relational.
- Since:
- 1.1
- Author:
- Jens Schauder, Mark Paluch
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The order used for thisEventListener
.Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ConstructorDescriptionRelationalAuditingCallback
(org.springframework.beans.factory.ObjectFactory<org.springframework.data.auditing.IsNewAwareAuditingHandler> auditingHandlerFactory) -
Method Summary
Modifier and TypeMethodDescriptionint
getOrder()
onBeforeConvert
(Object entity) Entity callback method invoked before an aggregate root is converted to be persisted.
-
Field Details
-
AUDITING_ORDER
public static final int AUDITING_ORDERThe order used for thisEventListener
. Ordering ensures that thisApplicationListener
will run before other listeners without a specified priority.- See Also:
-
Order
Ordered
- Constant Field Values
-
-
Constructor Details
-
RelationalAuditingCallback
public RelationalAuditingCallback(org.springframework.beans.factory.ObjectFactory<org.springframework.data.auditing.IsNewAwareAuditingHandler> auditingHandlerFactory)
-
-
Method Details
-
getOrder
public int getOrder()- Specified by:
getOrder
in interfaceorg.springframework.core.Ordered
-
onBeforeConvert
Description copied from interface:BeforeConvertCallback
Entity callback method invoked before an aggregate root is converted to be persisted. Can return either the same or a modified instance of the aggregate.- Specified by:
onBeforeConvert
in interfaceBeforeConvertCallback<Object>
- Parameters:
entity
- the saved aggregate.- Returns:
- the aggregate to be persisted.
-