Class AuditingHandler
java.lang.Object
org.springframework.data.auditing.AuditingHandlerSupport
org.springframework.data.auditing.AuditingHandler
- All Implemented Interfaces:
- InitializingBean
- Direct Known Subclasses:
- IsNewAwareAuditingHandler
Auditing handler to mark entity objects created and modified.
- Since:
- 1.5
- Author:
- Oliver Gierke, Christoph Strobl
- 
Constructor SummaryConstructorsConstructorDescriptionAuditingHandler(PersistentEntities entities) Creates a newAuditableBeanWrapperusing the givenPersistentEntitieswhen looking up auditing metadata via reflection.
- 
Method SummaryModifier and TypeMethodDescriptionvoidstatic AuditingHandlerfrom(MappingContext<?, ?> mappingContext) Factory method that creates a newAuditingHandlerfor the givenMappingContext.<T> TmarkCreated(T source) Marks the given object as created.<T> TmarkModified(T source) Marks the given object as modified.voidsetAuditorAware(@Nullable AuditorAware<?> auditorAware) Setter to inject aAuditorAwarecomponent to retrieve the current auditor.Methods inherited from class org.springframework.data.auditing.AuditingHandlerSupportisAuditable, setDateTimeForNow, setDateTimeProvider, setModifyOnCreation
- 
Constructor Details- 
AuditingHandlerCreates a newAuditableBeanWrapperusing the givenPersistentEntitieswhen looking up auditing metadata via reflection.- Parameters:
- entities- must not be null.
- Since:
- 1.10
 
 
- 
- 
Method Details- 
fromFactory method that creates a newAuditingHandlerfor the givenMappingContext.- Parameters:
- mappingContext- must not be null.
- Since:
- 3.0
 
- 
setAuditorAwareSetter to inject aAuditorAwarecomponent to retrieve the current auditor.- Parameters:
- auditorAware- can be null if no auditor-aware is available.
 
- 
markCreatedpublic <T> T markCreated(T source) Marks the given object as created.- Parameters:
- source-
 
- 
markModifiedpublic <T> T markModified(T source) Marks the given object as modified.- Parameters:
- source-
 
- 
afterPropertiesSetpublic void afterPropertiesSet()- Specified by:
- afterPropertiesSetin interface- InitializingBean
 
 
-