Spring Data Core

org.springframework.data.auditing
Class IsNewAwareAuditingHandler

java.lang.Object
  extended by org.springframework.data.auditing.AuditingHandler
      extended by org.springframework.data.auditing.IsNewAwareAuditingHandler
All Implemented Interfaces:
InitializingBean

public class IsNewAwareAuditingHandler
extends AuditingHandler

AuditingHandler extension that uses an IsNewStrategyFactory 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

Constructor Summary
IsNewAwareAuditingHandler(IsNewStrategyFactory isNewStrategyFactory)
          Deprecated. use constructor taking a MappingContext directly. Will be removed in 1.9.
IsNewAwareAuditingHandler(MappingContext<? extends PersistentEntity<?,?>,? extends PersistentProperty<?>> mappingContext)
          Creates a new IsNewAwareAuditingHandler for the given MappingContext.
 
Method Summary
 void markAudited(Object object)
          Marks the given object created or modified based on the IsNewStrategy returned by the IsNewStrategyFactory configured.
 
Methods inherited from class org.springframework.data.auditing.AuditingHandler
afterPropertiesSet, markCreated, markModified, setAuditorAware, setDateTimeForNow, setDateTimeProvider, setModifyOnCreation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IsNewAwareAuditingHandler

public IsNewAwareAuditingHandler(MappingContext<? extends PersistentEntity<?,?>,? extends PersistentProperty<?>> mappingContext)
Creates a new IsNewAwareAuditingHandler for the given MappingContext.

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

IsNewAwareAuditingHandler

@Deprecated
public IsNewAwareAuditingHandler(IsNewStrategyFactory isNewStrategyFactory)
Deprecated. use constructor taking a MappingContext directly. Will be removed in 1.9.

Creates a new IsNewAwareAuditingHandler using the given IsNewStrategyFactory.

Parameters:
isNewStrategyFactory - must not be null.
Method Detail

markAudited

public void markAudited(Object object)
Marks the given object created or modified based on the IsNewStrategy returned by the IsNewStrategyFactory configured. Will rout the calls to AuditingHandler.markCreated(Object) and AuditingHandler.markModified(Object) accordingly.

Parameters:
object -

Spring Data Core

Copyright © 2011-2014–2014 Pivotal Software, Inc.. All rights reserved.