Class IsNewAwareAuditingHandler
java.lang.Object
org.springframework.data.auditing.AuditingHandlerSupport
org.springframework.data.auditing.AuditingHandler
org.springframework.data.auditing.IsNewAwareAuditingHandler
- All Implemented Interfaces:
InitializingBean
AuditingHandler
extension that uses PersistentEntity.isNew(Object)
to expose a generic
markAudited(Object)
method that will route calls to AuditingHandler.markCreated(Object)
or
AuditingHandler.markModified(Object)
based on the IsNewStrategy
determined from the factory.- Since:
- 1.5
- Author:
- Oliver Gierke, Christoph Strobl
-
Constructor Summary
ConstructorDescriptionIsNewAwareAuditingHandler
(PersistentEntities entities) Creates a newIsNewAwareAuditingHandler
for the givenMappingContext
. -
Method Summary
Modifier and TypeMethodDescriptionmarkAudited
(Object object) Marks the given object created or modified based onPersistentEntity.isNew(Object)
.Methods inherited from class org.springframework.data.auditing.AuditingHandler
afterPropertiesSet, markCreated, markModified, setAuditorAware
Methods inherited from class org.springframework.data.auditing.AuditingHandlerSupport
isAuditable, setDateTimeForNow, setDateTimeProvider, setModifyOnCreation
-
Constructor Details
-
IsNewAwareAuditingHandler
Creates a newIsNewAwareAuditingHandler
for the givenMappingContext
.- Parameters:
entities
- must not be null.- Since:
- 1.10
-
-
Method Details
-
markAudited
Marks the given object created or modified based onPersistentEntity.isNew(Object)
. Will route the calls toAuditingHandler.markCreated(Object)
andAuditingHandler.markModified(Object)
accordingly.- Parameters:
object
- must not be null.
-