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 voidaddProjectionToQuery(org.hibernate.envers.boot.internal.EnversService enversService, org.hibernate.envers.internal.reader.AuditReaderImplementor auditReader, Map<String,String> aliasToEntityNameMap, Map<String,String> aliasToComponentPropertyNameMap, String baseAlias, org.hibernate.envers.internal.tools.query.QueryBuilder queryBuilder)Adds an audit projection to the specified query.ObjectconvertQueryResult(org.hibernate.envers.boot.internal.EnversService enversService, org.hibernate.envers.internal.entities.EntityInstantiator entityInstantiator, String entityName, Number revision, Object value)AuditCriterioneq(Object value)Apply an "equal" constraintAuditCriterioneqFunction(AuditFunction otherFunction)Apply an "equal" constraint to another functionAuditCriterioneqProperty(String propertyName)Apply an "equal" constraint to a propertyAuditCriterioneqProperty(String alias, String propertyName)Apply an "equal" constraint to a propertyAuditCriterionge(Object value)Apply a "greater than or equal" constraintAuditCriteriongeFunction(AuditFunction otherFunction)Apply a "greater than or equal" constraint to another functionAuditCriteriongeProperty(String propertyName)Apply a "greater than or equal" constraint to a propertyAuditCriteriongeProperty(String alias, String propertyName)Apply a "greater than or equal" constraint to a propertyStringgetAlias(String baseAlias)Get the alias associated with the audit projection.List<Object>getArguments()StringgetFunction()AuditCriteriongt(Object value)Apply a "greater than" constraintAuditCriteriongtFunction(AuditFunction otherFunction)Apply a "greater than" constraint to another functionAuditCriteriongtProperty(String propertyName)Apply a "greater than" constraint to a propertyAuditCriteriongtProperty(String alias, String propertyName)Apply a "greater than" constraint to a propertyAuditCriterionle(Object value)Apply a "less than or equal" constraintAuditCriterionleFunction(AuditFunction otherFunction)Apply a "less than or equal" constraint to another functionAuditCriterionleProperty(String propertyName)Apply a "less than or equal" constraint to a propertyAuditCriterionleProperty(String alias, String propertyName)Apply a "less than or equal" constraint to a propertyAuditCriterionlike(Object value)Apply a "like" constraintAuditCriterionlike(String value, MatchMode matchMode)Apply a "like" constraintAuditCriterionlt(Object value)Apply a "less than" constraintAuditCriterionltFunction(AuditFunction otherFunction)Apply a "less than" constraint to another functionAuditCriterionltProperty(String propertyName)Apply a "less than" constraint to a propertyAuditCriterionltProperty(String alias, String propertyName)Apply a "less than" constraint to a propertyAuditCriterionne(Object value)Apply a "not equal" constraintAuditCriterionneFunction(AuditFunction otherFunction)Apply a "not equal" constraint to another functionAuditCriterionneProperty(String propertyName)Apply a "not equal" constraint to a propertyAuditCriterionneProperty(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(org.hibernate.envers.boot.internal.EnversService enversService, org.hibernate.envers.internal.reader.AuditReaderImplementor auditReader, Map<String,String> aliasToEntityNameMap, Map<String,String> aliasToComponentPropertyNameMap, String baseAlias, org.hibernate.envers.internal.tools.query.QueryBuilder queryBuilder)Description copied from interface:AuditProjectionAdds an audit projection to the specified query.- Specified by:
addProjectionToQueryin 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(org.hibernate.envers.boot.internal.EnversService enversService, org.hibernate.envers.internal.entities.EntityInstantiator entityInstantiator, String entityName, Number revision, Object value)
- Specified by:
convertQueryResultin 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:AuditProjectionGet the alias associated with the audit projection.- Specified by:
getAliasin interfaceAuditProjection- Parameters:
baseAlias- the base alias if one exists; may be null- Returns:
- the alias
-
-