public abstract class AuditingHandlerSupport extends Object
Constructor and Description |
---|
AuditingHandlerSupport(PersistentEntities entities)
Creates a new
AuditableBeanWrapper using the given PersistentEntities when looking up auditing
metadata via reflection. |
Modifier and Type | Method and Description |
---|---|
protected boolean |
isAuditable(Object source)
Returns whether the given source is considered to be auditable in the first place.
|
void |
setDateTimeForNow(boolean dateTimeForNow)
Setter do determine if
Auditable.setCreatedDate(TemporalAccessor) } and
Auditable.setLastModifiedDate(TemporalAccessor) shall be filled with the current Java time. |
void |
setDateTimeProvider(DateTimeProvider dateTimeProvider)
Sets the
DateTimeProvider to be used to determine the dates to be set. |
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.
|
public AuditingHandlerSupport(PersistentEntities entities)
AuditableBeanWrapper
using the given PersistentEntities
when looking up auditing
metadata via reflection.entities
- must not be null.public void setDateTimeForNow(boolean dateTimeForNow)
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.dateTimeForNow
- the dateTimeForNow to setpublic void setModifyOnCreation(boolean modifyOnCreation)
true
.modifyOnCreation
- if modification information shall be set on creation, toopublic void setDateTimeProvider(@Nullable DateTimeProvider dateTimeProvider)
DateTimeProvider
to be used to determine the dates to be set.dateTimeProvider
- can be null, defaults to CurrentDateTimeProvider
in that case.protected final boolean isAuditable(Object source)
source
- must not be null.Copyright © 2011–2020 Pivotal Software, Inc.. All rights reserved.