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
ConstructorsConstructorDescriptionIsNewAwareAuditingHandler(PersistentEntities entities) Creates a newIsNewAwareAuditingHandlerfor the givenPersistentEntities. -
Method Summary
Modifier and TypeMethodDescriptionstatic IsNewAwareAuditingHandlerfrom(MappingContext<?, ?> mappingContext) Factory method that creates a newIsNewAwareAuditingHandlerfor 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, setAuditorAwareMethods inherited from class org.springframework.data.auditing.AuditingHandlerSupport
isAuditable, setDateTimeForNow, setDateTimeProvider, setModifyOnCreation
-
Constructor Details
-
IsNewAwareAuditingHandler
Creates a newIsNewAwareAuditingHandlerfor the givenPersistentEntities.- Parameters:
entities- must not be null.- Since:
- 1.10
-
-
Method Details
-
from
Factory method that creates a newIsNewAwareAuditingHandlerfor 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.
-