Class AuditProperty<T>
java.lang.Object
org.hibernate.envers.query.criteria.AuditProperty<T>
- All Implemented Interfaces:
AuditProjection
- Direct Known Subclasses:
AuditId
Create restrictions, projections and specify order for a property of an audited entity.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.asc()
Sort the results by the property in ascending orderApply a "between" constraintconvertQueryResult
(EnversService enversService, EntityInstantiator entityInstantiator, String entityName, Number revision, Object value) count()
Projection counting the valuesProjection counting distinct valuesdesc()
Sort the results by the property in descending orderdistinct()
Projection on distinct valuesApply an "equal" constrainteqFunction
(AuditFunction otherFunction) Apply an "equal" constraint to a functioneqProperty
(String otherPropertyName) Apply an "equal" constraint to another propertyeqProperty
(String otherAlias, String otherPropertyName) Apply an "equal" constraint to another propertyProjection using a custom functionApply a "greater than or equal" constraintgeFunction
(AuditFunction otherFunction) Apply a "greater than or equal" constraint to a functiongeProperty
(String otherPropertyName) Apply a "greater than or equal" constraint to another propertygeProperty
(String otherAlias, String otherPropertyName) Apply a "greater than or equal" constraint to another propertyGet the alias associated with the audit projection.Apply a "greater than" constraintgtFunction
(AuditFunction otherFunction) Apply a "greater than" constraint to a functiongtProperty
(String otherPropertyName) Apply a "greater than" constraint to another propertygtProperty
(String otherAlias, String otherPropertyName) Apply a "greater than" constraint to another propertyApply on "ilike" constraintApply an "ilike" constraintin
(Collection values) Apply an "in" constraintApply an "in" constraintApply an "is not null" constraint to the another propertyisNull()
Apply an "is null" constraintApply a "less than or equal" constraintleFunction
(AuditFunction otherFunction) Apply a "less than or equal" constraint to a functionleProperty
(String otherPropertyName) Apply a "less than or equal" constraint to another propertyleProperty
(String otherAlias, String otherPropertyName) Apply a "less than or equal" constraint to another propertyApply a "like" constraintApply a "like" constraintApply a "less than" constraintltFunction
(AuditFunction otherFunction) Apply a "less than" constraint to a functionltProperty
(String otherPropertyName) Apply a "less than" constraint to another propertyltProperty
(String otherAlias, String otherPropertyName) Apply a "less than" constraint to another propertymax()
Projection on the maximum valuemaximize()
Apply a "maximalize" constraint, with the ability to specify further constraints on the maximized propertymin()
Projection on the minimum valueminimize()
Apply a "minimize" constraint, with the ability to specify further constraints on the minimized propertyApply a "not equal" constraintneFunction
(AuditFunction otherFunction) Apply a "not equal" constraint to a functionneProperty
(String otherPropertyName) Apply a "not equal" constraint to another propertyneProperty
(String otherAlias, String otherPropertyName) Apply a "not equal" constraint to another property
-
Constructor Details
-
AuditProperty
-
-
Method Details
-
getAlias
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
-
getPropertyNameGetter
-
hasChanged
-
hasNotChanged
-
eq
Apply an "equal" constraint -
ne
Apply a "not equal" constraint -
like
Apply a "like" constraint -
like
Apply a "like" constraint -
ilike
Apply an "ilike" constraint -
ilike
Apply on "ilike" constraint -
gt
Apply a "greater than" constraint -
lt
Apply a "less than" constraint -
le
Apply a "less than or equal" constraint -
ge
Apply a "greater than or equal" constraint -
between
Apply a "between" constraint -
in
Apply an "in" constraint -
in
Apply an "in" constraint -
isNull
Apply an "is null" constraint -
eqProperty
Apply an "equal" constraint to another property -
eqProperty
Apply an "equal" constraint to another property- Parameters:
otherAlias
- the alias of the entity which owns the other property.
-
neProperty
Apply a "not equal" constraint to another property -
neProperty
Apply a "not equal" constraint to another property- Parameters:
otherAlias
- the alias of the entity which owns the other property.
-
ltProperty
Apply a "less than" constraint to another property -
ltProperty
Apply a "less than" constraint to another property- Parameters:
otherAlias
- the alias of the entity which owns the other property.
-
leProperty
Apply a "less than or equal" constraint to another property -
leProperty
Apply a "less than or equal" constraint to another property- Parameters:
otherAlias
- the alias of the entity which owns the other property.
-
gtProperty
Apply a "greater than" constraint to another property -
gtProperty
Apply a "greater than" constraint to another property- Parameters:
otherAlias
- the alias of the entity which owns the other property.
-
geProperty
Apply a "greater than or equal" constraint to another property -
geProperty
Apply a "greater than or equal" constraint to another property- Parameters:
otherAlias
- the alias of the entity which owns the other property.
-
eqFunction
Apply an "equal" constraint to a function -
neFunction
Apply a "not equal" constraint to a function -
ltFunction
Apply a "less than" constraint to a function -
leFunction
Apply a "less than or equal" constraint to a function -
gtFunction
Apply a "greater than" constraint to a function -
geFunction
Apply a "greater than or equal" constraint to a function -
isNotNull
Apply an "is not null" constraint to the another property -
maximize
Apply a "maximalize" constraint, with the ability to specify further constraints on the maximized property -
minimize
Apply a "minimize" constraint, with the ability to specify further constraints on the minimized property -
max
Projection on the maximum value -
min
Projection on the minimum value -
count
Projection counting the values -
countDistinct
Projection counting distinct values -
distinct
Projection on distinct values -
function
Projection using a custom 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
-
asc
Sort the results by the property in ascending order -
desc
Sort the results by the property in descending order -
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
-