Class AuditingHandlerSupport

java.lang.Object
org.springframework.data.auditing.AuditingHandlerSupport
Direct Known Subclasses:
AuditingHandler, ReactiveAuditingHandler

public abstract class AuditingHandlerSupport extends Object
Support class to implement auditing handlers.
Since:
2.4
Author:
Oliver Gierke, Christoph Strobl, Mark Paluch
  • Constructor Details

  • Method Details

    • setDateTimeForNow

      public void setDateTimeForNow(boolean dateTimeForNow)
      Setter do determine if Auditable.setCreatedDate(TemporalAccessor)} and Auditable.setLastModifiedDate(TemporalAccessor) shall be filled with the current Java time. Defaults to true. One might set this to false to use database features to set entity time.
      Parameters:
      dateTimeForNow - the dateTimeForNow to set
    • setModifyOnCreation

      public void setModifyOnCreation(boolean modifyOnCreation)
      Set this to true if you want to treat entity creation as modification and thus setting the current date as modification date during creation, too. Defaults to true.
      Parameters:
      modifyOnCreation - if modification information shall be set on creation, too
    • setDateTimeProvider

      public void setDateTimeProvider(@Nullable DateTimeProvider dateTimeProvider)
      Sets the DateTimeProvider to be used to determine the dates to be set.
      Parameters:
      dateTimeProvider - can be null, defaults to CurrentDateTimeProvider in that case.
    • isAuditable

      protected final boolean isAuditable(Object source)
      Returns whether the given source is considered to be auditable in the first place.
      Parameters:
      source - must not be null.
      Returns:
      true if the given source considered to be auditable.