|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AuditStrategy
Behaviours of different audit strategy for populating audit data.
Method Summary | |
---|---|
void |
addAssociationAtRevisionRestriction(QueryBuilder rootQueryBuilder,
String revisionProperty,
String revisionEndProperty,
boolean addAlias,
MiddleIdData referencingIdData,
String versionsMiddleEntityName,
String eeOriginalIdPropertyPath,
String revisionPropertyPath,
String originalIdPropertyName,
MiddleComponentData... componentDatas)
Update the rootQueryBuilder with an extra WHERE clause to restrict the revision for a middle-entity association. |
void |
addEntityAtRevisionRestriction(GlobalConfiguration globalCfg,
QueryBuilder rootQueryBuilder,
String revisionProperty,
String revisionEndProperty,
boolean addAlias,
MiddleIdData idData,
String revisionPropertyPath,
String originalIdPropertyName,
String alias1,
String alias2)
Update the rootQueryBuilder with an extra WHERE clause to restrict the revision for a two-entity relation. |
void |
perform(Session session,
String entityName,
AuditConfiguration auditCfg,
Serializable id,
Object data,
Object revision)
Perform the persistence of audited data for regular entities. |
void |
performCollectionChange(Session session,
AuditConfiguration auditCfg,
PersistentCollectionChangeData persistentCollectionChangeData,
Object revision)
Perform the persistence of audited data for collection ("middle") entities. |
Method Detail |
---|
void perform(Session session, String entityName, AuditConfiguration auditCfg, Serializable id, Object data, Object revision)
session
- Session, which can be used to persist the data.entityName
- Name of the entity, in which the audited change happensauditCfg
- Audit configurationid
- Id of the entity.data
- Audit data to persistrevision
- Current revision datavoid performCollectionChange(Session session, AuditConfiguration auditCfg, PersistentCollectionChangeData persistentCollectionChangeData, Object revision)
session
- Session, which can be used to persist the data.auditCfg
- Audit configurationpersistentCollectionChangeData
- Collection change data to be persisted.revision
- Current revision datavoid addEntityAtRevisionRestriction(GlobalConfiguration globalCfg, QueryBuilder rootQueryBuilder, String revisionProperty, String revisionEndProperty, boolean addAlias, MiddleIdData idData, String revisionPropertyPath, String originalIdPropertyName, String alias1, String alias2)
DefaultAuditStrategy
a subquery is created:
e.revision = (SELECT max(...) ...)
ValidityAuditStrategy
the revision-end column is used:
e.revision <= :revision and (e.endRevision > :revision or e.endRevision is null)
globalCfg
- the GlobalConfiguration
rootQueryBuilder
- the QueryBuilder
that will be updatedrevisionProperty
- property of the revision columnrevisionEndProperty
- property of the revisionEnd column (only used for ValidityAuditStrategy
)addAlias
- boolean
indicator if a left alias is neededidData
- id-information for the two-entity relation (only used for DefaultAuditStrategy
)revisionPropertyPath
- path of the revision property (only used for ValidityAuditStrategy
)originalIdPropertyName
- name of the id property (only used for ValidityAuditStrategy
)alias1
- an alias used for subquery (only used for ValidityAuditStrategy
)alias2
- an alias used for subquery (only used for ValidityAuditStrategy
)void addAssociationAtRevisionRestriction(QueryBuilder rootQueryBuilder, String revisionProperty, String revisionEndProperty, boolean addAlias, MiddleIdData referencingIdData, String versionsMiddleEntityName, String eeOriginalIdPropertyPath, String revisionPropertyPath, String originalIdPropertyName, MiddleComponentData... componentDatas)
DefaultAuditStrategy
a subquery is created:
e.revision = (SELECT max(...) ...)
ValidityAuditStrategy
the revision-end column is used:
e.revision <= :revision and (e.endRevision > :revision or e.endRevision is null)
rootQueryBuilder
- the QueryBuilder
that will be updatedrevisionProperty
- property of the revision columnrevisionEndProperty
- property of the revisionEnd column (only used for ValidityAuditStrategy
)addAlias
- boolean
indicator if a left alias is neededreferencingIdData
- id-information for the middle-entity association (only used for DefaultAuditStrategy
)versionsMiddleEntityName
- name of the middle-entityeeOriginalIdPropertyPath
- name of the id property (only used for ValidityAuditStrategy
)revisionPropertyPath
- path of the revision property (only used for ValidityAuditStrategy
)originalIdPropertyName
- name of the id property (only used for ValidityAuditStrategy
)componentDatas
- information about the middle-entity relation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |