Class AuditFunction

java.lang.Object
org.hibernate.envers.query.criteria.AuditFunction
All Implemented Interfaces:
AuditProjection

public class AuditFunction extends Object implements AuditProjection
Create restrictions or projections using a function.
  • Constructor Details

    • AuditFunction

      public AuditFunction(String function, List<Object> arguments)
  • Method Details

    • getFunction

      public String getFunction()
    • getArguments

      public List<Object> getArguments()
    • eq

      public AuditCriterion eq(Object value)
      Apply an "equal" constraint
    • ne

      public AuditCriterion ne(Object value)
      Apply a "not equal" constraint
    • like

      public AuditCriterion like(Object value)
      Apply a "like" constraint
    • like

      public AuditCriterion like(String value, MatchMode matchMode)
      Apply a "like" constraint
    • gt

      public AuditCriterion gt(Object value)
      Apply a "greater than" constraint
    • lt

      public AuditCriterion lt(Object value)
      Apply a "less than" constraint
    • le

      public AuditCriterion le(Object value)
      Apply a "less than or equal" constraint
    • ge

      public AuditCriterion ge(Object value)
      Apply a "greater than or equal" constraint
    • eqProperty

      public AuditCriterion eqProperty(String propertyName)
      Apply an "equal" constraint to a property
    • eqProperty

      public AuditCriterion eqProperty(String alias, String propertyName)
      Apply an "equal" constraint to a property
      Parameters:
      alias - the alias of the entity which owns the property.
    • neProperty

      public AuditCriterion neProperty(String propertyName)
      Apply a "not equal" constraint to a property
    • neProperty

      public AuditCriterion neProperty(String alias, String propertyName)
      Apply a "not equal" constraint to a property
      Parameters:
      alias - the alias of the entity which owns the property.
    • ltProperty

      public AuditCriterion ltProperty(String propertyName)
      Apply a "less than" constraint to a property
    • ltProperty

      public AuditCriterion ltProperty(String alias, String propertyName)
      Apply a "less than" constraint to a property
      Parameters:
      alias - the alias of the entity which owns the property.
    • leProperty

      public AuditCriterion leProperty(String propertyName)
      Apply a "less than or equal" constraint to a property
    • leProperty

      public AuditCriterion leProperty(String alias, String propertyName)
      Apply a "less than or equal" constraint to a property
      Parameters:
      alias - the alias of the entity which owns the property.
    • gtProperty

      public AuditCriterion gtProperty(String propertyName)
      Apply a "greater than" constraint to a property
    • gtProperty

      public AuditCriterion gtProperty(String alias, String propertyName)
      Apply a "greater than" constraint to a property
      Parameters:
      alias - the alias of the entity which owns the property.
    • geProperty

      public AuditCriterion geProperty(String propertyName)
      Apply a "greater than or equal" constraint to a property
    • geProperty

      public AuditCriterion geProperty(String alias, String propertyName)
      Apply a "greater than or equal" constraint to a property
      Parameters:
      alias - the alias of the entity which owns the property.
    • eqFunction

      public AuditCriterion eqFunction(AuditFunction otherFunction)
      Apply an "equal" constraint to another function
    • neFunction

      public AuditCriterion neFunction(AuditFunction otherFunction)
      Apply a "not equal" constraint to another function
    • ltFunction

      public AuditCriterion ltFunction(AuditFunction otherFunction)
      Apply a "less than" constraint to another function
    • leFunction

      public AuditCriterion leFunction(AuditFunction otherFunction)
      Apply a "less than or equal" constraint to another function
    • gtFunction

      public AuditCriterion gtFunction(AuditFunction otherFunction)
      Apply a "greater than" constraint to another function
    • geFunction

      public AuditCriterion geFunction(AuditFunction otherFunction)
      Apply a "greater than or equal" constraint to another function
    • addProjectionToQuery

      public void addProjectionToQuery(EnversService enversService, AuditReaderImplementor auditReader, Map<String,String> aliasToEntityNameMap, Map<String,String> aliasToComponentPropertyNameMap, String baseAlias, QueryBuilder queryBuilder)
      Description copied from interface: AuditProjection
      Adds an audit projection to the specified query.
      Specified by:
      addProjectionToQuery in interface AuditProjection
      Parameters:
      enversService - the Envers service
      auditReader - the audit reader implementor
      aliasToEntityNameMap - the entity name alias map
      baseAlias - the base alias, if one is specified; may be null
      queryBuilder - the query builder
    • convertQueryResult

      public Object convertQueryResult(EnversService enversService, EntityInstantiator entityInstantiator, String entityName, Number revision, Object value)
      Specified by:
      convertQueryResult in interface AuditProjection
      Parameters:
      enversService - the Envers service
      entityInstantiator - the entity instantiator
      entityName - the name of the entity for which the projection has been added
      revision - the revision
      value - the value to convert
      Returns:
      the converted value
    • getAlias

      public String getAlias(String baseAlias)
      Description copied from interface: AuditProjection
      Get the alias associated with the audit projection.
      Specified by:
      getAlias in interface AuditProjection
      Parameters:
      baseAlias - the base alias if one exists; may be null
      Returns:
      the alias