org.springframework.data.auditing

## Class AuditingHandler

- java.lang.Object
- - org.springframework.data.auditing.AuditingHandlerSupport
  - - org.springframework.data.auditing.AuditingHandler

All Implemented Interfaces:
  InitializingBean

Direct Known Subclasses:
  IsNewAwareAuditingHandler

    public class AuditingHandler
    extends AuditingHandlerSupport
    implements InitializingBean

Auditing handler to mark entity objects created and modified.

Since:
  1.5
Author:
  Oliver Gierke, Christoph Strobl

### Constructor Summary

Constructors
Constructor and Description
`AuditingHandler(MappingContext<? extends PersistentEntity<?,?>,? extends PersistentProperty<?>> mappingContext)` Deprecated. use `AuditingHandler(PersistentEntities)` instead.
`AuditingHandler(PersistentEntities entities)` Creates a new `AuditableBeanWrapper` using the given `PersistentEntities` when looking up auditing metadata via reflection.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `afterPropertiesSet()`
`<T> T` `markCreated(T source)` Marks the given object as created.
`<T> T` `markModified(T source)` Marks the given object as modified.
`void` `setAuditorAware(AuditorAware<?> auditorAware)` Setter to inject a `AuditorAware` component to retrieve the current auditor.

### Methods inherited from class org.springframework.data.auditing.AuditingHandlerSupport

`isAuditable, setDateTimeForNow, setDateTimeProvider, setModifyOnCreation`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### AuditingHandler

    @Deprecated
    public AuditingHandler(MappingContext<? extends PersistentEntity<?,?>,? extends PersistentProperty<?>> mappingContext)

Deprecated. use `AuditingHandler(PersistentEntities)` instead.
Creates a new `AuditableBeanWrapper` using the given `MappingContext` when looking up auditing metadata via reflection.

Parameters:
  `mappingContext` - must not be null.
Since:
  1.8

#### AuditingHandler

    public AuditingHandler(PersistentEntities entities)

Creates a new `AuditableBeanWrapper` using the given `PersistentEntities` when looking up auditing metadata via reflection.

Parameters:
  `entities` - must not be null.
Since:
  1.10

### Method Detail

#### setAuditorAware

    public void setAuditorAware(AuditorAware<?> auditorAware)

Setter to inject a `AuditorAware` component to retrieve the current auditor.

Parameters:
  `auditorAware` - must not be null.

#### markCreated

    public <T> T markCreated(T source)

Marks the given object as created.

Parameters:
  `source` -

#### markModified

    public <T> T markModified(T source)

Marks the given object as modified.

Parameters:
  `source` -

#### afterPropertiesSet

    public void afterPropertiesSet()

Specified by:
  `afterPropertiesSet` in interface `InitializingBean`