Package org.hibernate.envers.query
Class AuditEntity
java.lang.Object
org.hibernate.envers.query.AuditEntity
-
Method Summary
Modifier and TypeMethodDescriptionstatic AuditCriterionand(AuditCriterion lhs, AuditCriterion rhs) Return the conjuction of two criterions.static AuditConjunctionGroup criterions together in a single conjunction (A and B and C...).static AuditDisjunctionGroup criterions together in a single disjunction (A or B or C...).static AuditCriterionentityType(Class<?> type) Adds a restriction for the type of the current entity.static AuditCriterionentityType(String entityName) Adds a restriction for the type of the current entity.static AuditCriterionentityType(String alias, Class<?> type) Adds a restriction for the type of the entity of the specified alias.static AuditCriterionentityType(String alias, String entityName) Adds a restriction for the type of the entity of the specified alias.static AuditFunctionCreate restrictions or projections using a function.static AuditIdid()static AuditIdstatic AuditCriterionnot(AuditCriterion expression) Return the negation of a criterion.static AuditCriterionor(AuditCriterion lhs, AuditCriterion rhs) Return the disjuction of two criterions.static AuditProperty<Object> Create restrictions, projections and specify order for a property of an audited entity.static AuditProperty<Object> Create restrictions, projections and specify order for a property of an audited entity.static AuditRelatedIdCreate restrictions on an id of a related entity.static AuditRelatedIdCreate restrictions on an id of a related entity.static AuditProperty<Number> Create restrictions, projections and specify order for the revision number, corresponding to an audited entity.static AuditProperty<Number> revisionNumber(String alias) Create restrictions, projections and specify order for the revision number, corresponding to an audited entity.static AuditProperty<Object> revisionProperty(String propertyName) Create restrictions, projections and specify order for a property of the revision entity, corresponding to an audited entity.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.static AuditProperty<RevisionType> Create restrictions, projections and specify order for the revision type, corresponding to an audited entity.static AuditProperty<RevisionType> revisionType(String alias) Create restrictions, projections and specify order for the revision type, corresponding to an audited entity.static AuditProjectionselectEntity(boolean distinct) Adds a projection to the current entity itself.
-
Method Details
-
id
-
id
-
property
Create restrictions, projections and specify order for a property of an audited entity.- Parameters:
propertyName- Name of the property.
-
property
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
Create restrictions, projections and specify order for the revision number, corresponding to an audited entity. -
revisionNumber
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
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
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
Create restrictions, projections and specify order for the revision type, corresponding to an audited entity. -
revisionType
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.
-
and
Return the conjuction of two criterions. -
or
Return the disjuction of two criterions. -
not
Return the negation of a criterion. -
conjunction
Group criterions together in a single conjunction (A and B and C...). -
disjunction
Group criterions together in a single disjunction (A or B or C...). -
selectEntity
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
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 functionarguments- 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
Adds a restriction for the type of the current entity.- Parameters:
type- the entity type to restrict the current alias to
-
entityType
Adds a restriction for the type of the current entity.- Parameters:
entityName- the entity name to restrict the current alias to
-
entityType
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 usedtype- the entity type to restrict the alias to
-
entityType
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 usedentityName- the entity name to restrict the alias to- Returns:
-