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 Summary
Constructors Constructor Description AuditFunction(String function, List<Object> arguments)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addProjectionToQuery(EnversService enversService, AuditReaderImplementor auditReader, Map<String,String> aliasToEntityNameMap, Map<String,String> aliasToComponentPropertyNameMap, String baseAlias, QueryBuilder queryBuilder)
Adds an audit projection to the specified query.Object
convertQueryResult(EnversService enversService, EntityInstantiator entityInstantiator, String entityName, Number revision, Object value)
AuditCriterion
eq(Object value)
Apply an "equal" constraintAuditCriterion
eqFunction(AuditFunction otherFunction)
Apply an "equal" constraint to another functionAuditCriterion
eqProperty(String propertyName)
Apply an "equal" constraint to a propertyAuditCriterion
eqProperty(String alias, String propertyName)
Apply an "equal" constraint to a propertyAuditCriterion
ge(Object value)
Apply a "greater than or equal" constraintAuditCriterion
geFunction(AuditFunction otherFunction)
Apply a "greater than or equal" constraint to another functionAuditCriterion
geProperty(String propertyName)
Apply a "greater than or equal" constraint to a propertyAuditCriterion
geProperty(String alias, String propertyName)
Apply a "greater than or equal" constraint to a propertyString
getAlias(String baseAlias)
Get the alias associated with the audit projection.List<Object>
getArguments()
String
getFunction()
AuditCriterion
gt(Object value)
Apply a "greater than" constraintAuditCriterion
gtFunction(AuditFunction otherFunction)
Apply a "greater than" constraint to another functionAuditCriterion
gtProperty(String propertyName)
Apply a "greater than" constraint to a propertyAuditCriterion
gtProperty(String alias, String propertyName)
Apply a "greater than" constraint to a propertyAuditCriterion
le(Object value)
Apply a "less than or equal" constraintAuditCriterion
leFunction(AuditFunction otherFunction)
Apply a "less than or equal" constraint to another functionAuditCriterion
leProperty(String propertyName)
Apply a "less than or equal" constraint to a propertyAuditCriterion
leProperty(String alias, String propertyName)
Apply a "less than or equal" constraint to a propertyAuditCriterion
like(Object value)
Apply a "like" constraintAuditCriterion
like(String value, MatchMode matchMode)
Apply a "like" constraintAuditCriterion
lt(Object value)
Apply a "less than" constraintAuditCriterion
ltFunction(AuditFunction otherFunction)
Apply a "less than" constraint to another functionAuditCriterion
ltProperty(String propertyName)
Apply a "less than" constraint to a propertyAuditCriterion
ltProperty(String alias, String propertyName)
Apply a "less than" constraint to a propertyAuditCriterion
ne(Object value)
Apply a "not equal" constraintAuditCriterion
neFunction(AuditFunction otherFunction)
Apply a "not equal" constraint to another functionAuditCriterion
neProperty(String propertyName)
Apply a "not equal" constraint to a propertyAuditCriterion
neProperty(String alias, String propertyName)
Apply a "not equal" constraint to a property
-
-
-
Method Detail
-
getFunction
public String getFunction()
-
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 interfaceAuditProjection
- Parameters:
enversService
- the Envers serviceauditReader
- the audit reader implementoraliasToEntityNameMap
- the entity name alias mapbaseAlias
- the base alias, if one is specified; may be nullqueryBuilder
- the query builder
-
convertQueryResult
public Object convertQueryResult(EnversService enversService, EntityInstantiator entityInstantiator, String entityName, Number revision, Object value)
- Specified by:
convertQueryResult
in interfaceAuditProjection
- Parameters:
enversService
- the Envers serviceentityInstantiator
- the entity instantiatorentityName
- the name of the entity for which the projection has been addedrevision
- the revisionvalue
- 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 interfaceAuditProjection
- Parameters:
baseAlias
- the base alias if one exists; may be null- Returns:
- the alias
-
-