Class AuditEntity


  • public class AuditEntity
    extends Object
    • Method Detail

      • property

        public static AuditProperty<Object> property​(String propertyName)
        Create restrictions, projections and specify order for a property of an audited entity.
        Parameters:
        propertyName - Name of the property.
      • property

        public static AuditProperty<Object> property​(String alias,
                                                     String propertyName)
        Create restrictions, projections and specify order for a property of an audited entity.
        Parameters:
        alias - the alias of the entity which owns the property.
        propertyName - Name of the property.
      • revisionNumber

        public static AuditProperty<Number> revisionNumber()
        Create restrictions, projections and specify order for the revision number, corresponding to an audited entity.
      • revisionNumber

        public static AuditProperty<Number> revisionNumber​(String alias)
        Create restrictions, projections and specify order for the revision number, corresponding to an audited entity.
        Parameters:
        alias - the alias of the entity which owns the revision number.
      • revisionProperty

        public static AuditProperty<Object> revisionProperty​(String propertyName)
        Create restrictions, projections and specify order for a property of the revision entity, corresponding to an audited entity.
        Parameters:
        propertyName - Name of the property.
      • revisionProperty

        public static AuditProperty<Object> revisionProperty​(String alias,
                                                             String propertyName)
        Create restrictions, projections and specify order for a property of the revision entity, corresponding to an audited entity.
        Parameters:
        alias - the alias of the entity which owns the revision property.
        propertyName - Name of the property.
      • revisionType

        public static AuditProperty<RevisionType> revisionType()
        Create restrictions, projections and specify order for the revision type, corresponding to an audited entity.
      • revisionType

        public static AuditProperty<RevisionType> revisionType​(String alias)
        Create restrictions, projections and specify order for the revision type, corresponding to an audited entity.
        Parameters:
        alias - the alias of the entity which owns the revision type.
      • relatedId

        public static AuditRelatedId relatedId​(String propertyName)
        Create restrictions on an id of a related entity.
        Parameters:
        propertyName - Name of the property, which is the relation.
      • relatedId

        public static AuditRelatedId relatedId​(String alias,
                                               String propertyName)
        Create restrictions on an id of a related entity.
        Parameters:
        alias - the alias of the entity which owns the relation property.
        propertyName - Name of the property, which is the relation.
      • conjunction

        public static AuditConjunction conjunction()
        Group criterions together in a single conjunction (A and B and C...).
      • disjunction

        public static AuditDisjunction disjunction()
        Group criterions together in a single disjunction (A or B or C...).
      • selectEntity

        public static AuditProjection selectEntity​(boolean distinct)
        Adds a projection to the current entity itself. Useful for selecting entities which are reached through associations within the query.
        Parameters:
        distinct - whether to distinct select the entity
      • function

        public static AuditFunction function​(String function,
                                             Object... arguments)
        Create restrictions or projections using a function.

        Examples:

        • AuditEntity.function("upper", AuditEntity.property("prop"))
        • AuditEntity.function("substring", AuditEntity.property("prop"), 3, 2)
        • AuditEntity.function("concat", AuditEntity.function("upper", AuditEntity.property("prop1")), AuditEntity.function("substring", AuditEntity.property("prop2"), 1, 2))
        Parameters:
        function - the name of the function
        arguments - the arguments of the function. A function argument can either be
        • a primitive value like a Number or a String
        • an AuditProperty (see property(String))
        • an other AuditFunction
      • entityType

        public static AuditCriterion entityType​(Class<?> type)
        Adds a restriction for the type of the current entity.
        Parameters:
        type - the entity type to restrict the current alias to
      • entityType

        public static AuditCriterion entityType​(String entityName)
        Adds a restriction for the type of the current entity.
        Parameters:
        entityName - the entity name to restrict the current alias to
      • entityType

        public static AuditCriterion entityType​(String alias,
                                                Class<?> type)
        Adds a restriction for the type of the entity of the specified alias.
        Parameters:
        alias - the alias to restrict. If null is specified, the current alias is used
        type - the entity type to restrict the alias to
      • entityType

        public static AuditCriterion entityType​(String alias,
                                                String entityName)
        Adds a restriction for the type of the entity of the specified alias.
        Parameters:
        alias - the alias to restrict. If null is specified, the current alias is used
        entityName - the entity name to restrict the alias to
        Returns: