Interface AuditStrategy

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods 
      Modifier and Type Method Description
      void addAssociationAtRevisionRestriction​(org.hibernate.envers.internal.tools.query.QueryBuilder rootQueryBuilder, org.hibernate.envers.internal.tools.query.Parameters parameters, String revisionProperty, String revisionEndProperty, boolean addAlias, org.hibernate.envers.internal.entities.mapper.relation.MiddleIdData referencingIdData, String versionsMiddleEntityName, String eeOriginalIdPropertyPath, String revisionPropertyPath, String originalIdPropertyName, String alias1, boolean inclusive, org.hibernate.envers.internal.entities.mapper.relation.MiddleComponentData... componentDatas)
      Update the rootQueryBuilder with an extra WHERE clause to restrict the revision for a middle-entity association.
      void addEntityAtRevisionRestriction​(org.hibernate.envers.configuration.internal.GlobalConfiguration globalCfg, org.hibernate.envers.internal.tools.query.QueryBuilder rootQueryBuilder, org.hibernate.envers.internal.tools.query.Parameters parameters, String revisionProperty, String revisionEndProperty, boolean addAlias, org.hibernate.envers.internal.entities.mapper.relation.MiddleIdData idData, String revisionPropertyPath, String originalIdPropertyName, String alias1, String alias2, boolean inclusive)
      Update the rootQueryBuilder with an extra WHERE clause to restrict the revision for a two-entity relation.
      default void perform​(org.hibernate.Session session, String entityName, org.hibernate.envers.boot.internal.EnversService enversService, Serializable id, Object data, Object revision)
      void perform​(org.hibernate.Session session, String entityName, org.hibernate.envers.configuration.internal.AuditEntitiesConfiguration auditEntitiesConfiguration, Serializable id, Object data, Object revision)
      Perform the persistence of audited data for regular entities.
      default void performCollectionChange​(org.hibernate.Session session, String entityName, String propertyName, org.hibernate.envers.boot.internal.EnversService enversService, org.hibernate.envers.internal.entities.mapper.PersistentCollectionChangeData persistentCollectionChangeData, Object revision)
      void performCollectionChange​(org.hibernate.Session session, String entityName, String propertyName, org.hibernate.envers.configuration.internal.AuditEntitiesConfiguration auditEntitiesConfiguration, org.hibernate.envers.internal.entities.mapper.PersistentCollectionChangeData persistentCollectionChangeData, Object revision)
      Perform the persistence of audited data for collection ("middle") entities.
    • Method Detail

      • perform

        @Deprecated
        default void perform​(org.hibernate.Session session,
                             String entityName,
                             org.hibernate.envers.boot.internal.EnversService enversService,
                             Serializable id,
                             Object data,
                             Object revision)
        Perform the persistence of audited data for regular entities.
        Parameters:
        session - Session, which can be used to persist the data.
        entityName - Name of the entity, in which the audited change happens
        enversService - The EnversService
        id - Id of the entity.
        data - Audit data to persist
        revision - Current revision data
      • perform

        void perform​(org.hibernate.Session session,
                     String entityName,
                     org.hibernate.envers.configuration.internal.AuditEntitiesConfiguration auditEntitiesConfiguration,
                     Serializable id,
                     Object data,
                     Object revision)
        Perform the persistence of audited data for regular entities.
        Parameters:
        session - Session, which can be used to persist the data.
        entityName - Name of the entity, in which the audited change happens
        auditEntitiesConfiguration - The audit entity configuration.
        id - Id of the entity.
        data - Audit data to persist.
        revision - Current revision data.
      • performCollectionChange

        @Deprecated
        default void performCollectionChange​(org.hibernate.Session session,
                                             String entityName,
                                             String propertyName,
                                             org.hibernate.envers.boot.internal.EnversService enversService,
                                             org.hibernate.envers.internal.entities.mapper.PersistentCollectionChangeData persistentCollectionChangeData,
                                             Object revision)
        Perform the persistence of audited data for collection ("middle") entities.
        Parameters:
        session - Session, which can be used to persist the data.
        entityName - Name of the entity, in which the audited change happens.
        propertyName - The name of the property holding the persistent collection
        enversService - The EnversService
        persistentCollectionChangeData - Collection change data to be persisted.
        revision - Current revision data
      • performCollectionChange

        void performCollectionChange​(org.hibernate.Session session,
                                     String entityName,
                                     String propertyName,
                                     org.hibernate.envers.configuration.internal.AuditEntitiesConfiguration auditEntitiesConfiguration,
                                     org.hibernate.envers.internal.entities.mapper.PersistentCollectionChangeData persistentCollectionChangeData,
                                     Object revision)
        Perform the persistence of audited data for collection ("middle") entities.
        Parameters:
        session - Session, which can be used to persist the data.
        entityName - Name of the entity, in which the audited change happens.
        propertyName - The name of the property holding the persistent collection
        auditEntitiesConfiguration - audit entity configuration
        persistentCollectionChangeData - Collection change data to be persisted.
        revision - Current revision data
      • addEntityAtRevisionRestriction

        void addEntityAtRevisionRestriction​(org.hibernate.envers.configuration.internal.GlobalConfiguration globalCfg,
                                            org.hibernate.envers.internal.tools.query.QueryBuilder rootQueryBuilder,
                                            org.hibernate.envers.internal.tools.query.Parameters parameters,
                                            String revisionProperty,
                                            String revisionEndProperty,
                                            boolean addAlias,
                                            org.hibernate.envers.internal.entities.mapper.relation.MiddleIdData idData,
                                            String revisionPropertyPath,
                                            String originalIdPropertyName,
                                            String alias1,
                                            String alias2,
                                            boolean inclusive)
        Update the rootQueryBuilder with an extra WHERE clause to restrict the revision for a two-entity relation. This WHERE clause depends on the AuditStrategy, as follows:
        • For DefaultAuditStrategy a subquery is created:

          e.revision = (SELECT max(...) ...)

        • for ValidityAuditStrategy the revision-end column is used:

          e.revision <= :revision and (e.endRevision > :revision or e.endRevision is null)

        Parameters:
        globalCfg - the GlobalConfiguration
        rootQueryBuilder - the QueryBuilder that will be updated
        parameters - root parameters to which restrictions shall be added
        revisionProperty - property of the revision column
        revisionEndProperty - property of the revisionEnd column (only used for ValidityAuditStrategy)
        addAlias - boolean indicator if a left alias is needed
        idData - 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)
        inclusive - indicates whether revision number shall be treated as inclusive or exclusive
      • addAssociationAtRevisionRestriction

        void addAssociationAtRevisionRestriction​(org.hibernate.envers.internal.tools.query.QueryBuilder rootQueryBuilder,
                                                 org.hibernate.envers.internal.tools.query.Parameters parameters,
                                                 String revisionProperty,
                                                 String revisionEndProperty,
                                                 boolean addAlias,
                                                 org.hibernate.envers.internal.entities.mapper.relation.MiddleIdData referencingIdData,
                                                 String versionsMiddleEntityName,
                                                 String eeOriginalIdPropertyPath,
                                                 String revisionPropertyPath,
                                                 String originalIdPropertyName,
                                                 String alias1,
                                                 boolean inclusive,
                                                 org.hibernate.envers.internal.entities.mapper.relation.MiddleComponentData... componentDatas)
        Update the rootQueryBuilder with an extra WHERE clause to restrict the revision for a middle-entity association. This WHERE clause depends on the AuditStrategy, as follows:
        • For DefaultAuditStrategy a subquery is created:

          e.revision = (SELECT max(...) ...)

        • for ValidityAuditStrategy the revision-end column is used:

          e.revision <= :revision and (e.endRevision > :revision or e.endRevision is null)

        Parameters:
        rootQueryBuilder - the QueryBuilder that will be updated
        parameters - root parameters to which restrictions shall be added
        revisionProperty - property of the revision column
        revisionEndProperty - property of the revisionEnd column (only used for ValidityAuditStrategy)
        addAlias - boolean indicator if a left alias is needed
        referencingIdData - id-information for the middle-entity association (only used for DefaultAuditStrategy)
        versionsMiddleEntityName - name of the middle-entity
        eeOriginalIdPropertyPath - 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)
        alias1 - an alias used for subqueries (only used for DefaultAuditStrategy)
        inclusive - indicates whether revision number shall be treated as inclusive or exclusive
        componentDatas - information about the middle-entity relation