|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.synyx.hades.domain.auditing.AuditingAdvice<T>
T - the type of the auditing instancepublic class AuditingAdvice<T>
Aspect touching entities being saved. Sets modification date and auditor. If
no AuditorAware is set only modification and creation date will be
set.
The advice intercepts calls to save methods of
GenericDao. It is implemented using
Aspect annotations to be suitable for all kinds of aspect weaving. To
enable capturing audit data simply register the advice and activate
annotation based aspect:
<aop:aspectj-autoproxy /> <bean class="org.synyx.hades.domain.support.AuditionAdvice" />
| Constructor Summary | |
|---|---|
AuditingAdvice()
|
|
| Method Summary | |
|---|---|
void |
setAuditorAware(AuditorAware<T> auditorAware)
Setter to inject a AuditorAware component to retrieve the current
auditor. |
void |
setDateTimeForNow(boolean dateTimeForNow)
Setter do determine if Auditable.setCreated(DateTime) and
Auditable.setLastModified(DateTime) shall be filled with the
current Java time. |
void |
setModifyOnCreation(boolean modifyOnCreation)
Set this to false if you want to treat entity creation as modification and thus set the current date as modification date, too. |
void |
touch(Auditable<T,?> auditable)
Sets modification and creation date and auditor on an auditable entity. |
void |
touch(java.util.List<Auditable<T,?>> auditables)
Sets modification and creation date and auditor on a List of
Auditables. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AuditingAdvice()
| Method Detail |
|---|
public void setAuditorAware(AuditorAware<T> auditorAware)
AuditorAware component to retrieve the current
auditor.
auditorAware - the auditorAware to setpublic void setDateTimeForNow(boolean dateTimeForNow)
Auditable.setCreated(DateTime) and
Auditable.setLastModified(DateTime) 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 touch(Auditable<T,?> auditable)
auditable - public void touch(java.util.List<Auditable<T,?>> auditables)
List of
Auditables.
auditables -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||