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 givenPersistentEntities
. -
Method Summary
Modifier and TypeMethodDescriptionstatic IsNewAwareAuditingHandler
from
(MappingContext<?, ?> mappingContext) Factory method that creates a newIsNewAwareAuditingHandler
for the givenMappingContext
.markAudited
(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 givenPersistentEntities
.- Parameters:
entities
- must not be null.- Since:
- 1.10
-
-
Method Details
-
from
Factory method that creates a newIsNewAwareAuditingHandler
for the givenMappingContext
.- Parameters:
mappingContext
- must not be null.- Since:
- 3.0
-
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.
-