Class Parameters
- java.lang.Object
-
- org.hibernate.envers.internal.tools.query.Parameters
-
public class Parameters extends Object
Parameters of a query, built usingQueryBuilder
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEntityTypeRestriction(String alias, String entityName)
Parameters
addNegatedParameters()
Adds negated parameters, by default with the "and" connective.void
addNotNullRestriction(String propertyName, boolean addAlias)
AddsIS NOT NULL
restriction.void
addNotNullRestriction(String alias, String propertyName)
AddsIS NOT NULL
restriction.void
addNullRestriction(String propertyName, boolean addAlias)
AddsIS NULL
restriction.void
addNullRestriction(String alias, String propertyName)
AddsIS NULL
restriction.Parameters
addSubParameters(String newConnective)
Adds sub-parameters with a new connective.void
addWhere(String left, boolean addAliasLeft, String op, String right, boolean addAliasRight)
void
addWhere(String left, boolean addAlias, String op, QueryBuilder right)
void
addWhere(String aliasLeft, String left, String op, String aliasRight, String right)
void
addWhere(String leftAlias, String left, String op, QueryBuilder right)
void
addWhereOrNullRestriction(String left, boolean addAliasLeft, String op, String right, boolean addAliasRight)
Add where clause with a null restriction: (left = right or (left is null and right is null))void
addWhereWithFunction(String alias, String left, String leftFunction, String op, Object paramValue)
void
addWhereWithFunction(Configuration configuration, Map<String,String> aliasToEntityNameMap, Map<String,String> aliasToComponentPropertyNameMap, String aliasLeft, String left, String op, AuditFunction function)
Adds a where clause with a left (optionally aliased) property and a function call on the right side.void
addWhereWithFunction(Configuration configuration, Map<String,String> aliasToEntityNameMap, Map<String,String> aliasToComponentPropertyNameMap, AuditFunction function, String op, Object value)
Add where clause with a function call on the left and a scalar value on the right.void
addWhereWithFunction(Configuration configuration, Map<String,String> aliasToEntityNameMap, Map<String,String> aliasToComponentPropertyNameMap, AuditFunction function, String op, String aliasRight, String right)
Add a where clause with a function call on the left and an optionally aliased property on the right.void
addWhereWithFunction(Configuration configuration, Map<String,String> aliasToEntityNameMap, Map<String,String> aliasToComponentPropertyNameMap, AuditFunction left, String op, AuditFunction right)
Adds a where clause with a function call on both the left and right of the predicate.void
addWhereWithNamedParam(String left, boolean addAlias, String op, String paramName)
void
addWhereWithNamedParam(String left, String op, String paramName)
void
addWhereWithParam(String left, boolean addAlias, String op, Object paramValue)
void
addWhereWithParam(String left, String op, Object paramValue)
void
addWhereWithParam(String alias, String left, String op, Object paramValue)
void
addWhereWithParams(String alias, String left, String opStart, Object[] paramValues, String opEnd)
Parameters
deepCopy()
-
-
-
Field Detail
-
AND
public static final String AND
- See Also:
- Constant Field Values
-
OR
public static final String OR
- See Also:
- Constant Field Values
-
-
Method Detail
-
deepCopy
public Parameters deepCopy()
-
addSubParameters
public Parameters addSubParameters(String newConnective)
Adds sub-parameters with a new connective. That is, the parameters will be grouped in parentheses in the generated query, e.g.: ... and (exp1 or exp2) and ..., assuming the old connective is "and", and the new connective is "or".- Parameters:
newConnective
- New connective of the parameters.- Returns:
- Sub-parameters with the given connective.
-
addNegatedParameters
public Parameters addNegatedParameters()
Adds negated parameters, by default with the "and" connective. These paremeters will be grouped in parentheses in the generated query and negated, e.g. ... not (exp1 and exp2) ...- Returns:
- Negated sub paremters.
-
addNullRestriction
public void addNullRestriction(String propertyName, boolean addAlias)
AddsIS NULL
restriction.- Parameters:
propertyName
- Property name.addAlias
- Positive if an alias to property name shall be added.
-
addNullRestriction
public void addNullRestriction(String alias, String propertyName)
AddsIS NULL
restriction.- Parameters:
alias
- the alias which should be added to the property name.propertyName
- Property name.
-
addNotNullRestriction
public void addNotNullRestriction(String propertyName, boolean addAlias)
AddsIS NOT NULL
restriction.- Parameters:
propertyName
- Property name.addAlias
- Positive if an alias to property name shall be added.
-
addNotNullRestriction
public void addNotNullRestriction(String alias, String propertyName)
AddsIS NOT NULL
restriction.- Parameters:
alias
- the alias which should be added to the property name.propertyName
- Property name.
-
addWhere
public void addWhere(String left, boolean addAliasLeft, String op, String right, boolean addAliasRight)
-
addWhere
public void addWhere(String aliasLeft, String left, String op, String aliasRight, String right)
-
addWhereWithFunction
public void addWhereWithFunction(String alias, String left, String leftFunction, String op, Object paramValue)
-
addWhereWithParam
public void addWhereWithParam(String alias, String left, String op, Object paramValue)
-
addWhereWithParam
public void addWhereWithParam(String left, boolean addAlias, String op, Object paramValue)
-
addWhereWithNamedParam
public void addWhereWithNamedParam(String left, String op, String paramName)
-
addWhereWithNamedParam
public void addWhereWithNamedParam(String left, boolean addAlias, String op, String paramName)
-
addWhereWithParams
public void addWhereWithParams(String alias, String left, String opStart, Object[] paramValues, String opEnd)
-
addWhere
public void addWhere(String left, boolean addAlias, String op, QueryBuilder right)
-
addWhere
public void addWhere(String leftAlias, String left, String op, QueryBuilder right)
-
addWhereOrNullRestriction
public void addWhereOrNullRestriction(String left, boolean addAliasLeft, String op, String right, boolean addAliasRight)
Add where clause with a null restriction: (left = right or (left is null and right is null))- Parameters:
left
- Left property name.addAliasLeft
- Whether to add the alias to the left property.op
- The operator.right
- Right property name.addAliasRight
- Whether to add the alias to the right property.
-
addWhereWithFunction
public void addWhereWithFunction(Configuration configuration, Map<String,String> aliasToEntityNameMap, Map<String,String> aliasToComponentPropertyNameMap, AuditFunction function, String op, Object value)
Add where clause with a function call on the left and a scalar value on the right.- Parameters:
configuration
- the configuration.aliasToEntityNameMap
- alias to entity name map, never nullaliasToComponentPropertyNameMap
- alias to component property name map, never nullfunction
- the function.op
- the operator.value
- the scalar value.
-
addWhereWithFunction
public void addWhereWithFunction(Configuration configuration, Map<String,String> aliasToEntityNameMap, Map<String,String> aliasToComponentPropertyNameMap, AuditFunction function, String op, String aliasRight, String right)
Add a where clause with a function call on the left and an optionally aliased property on the right.- Parameters:
configuration
- the configuration.aliasToEntityNameMap
- alias to entity name map, never nullaliasToComponentPropertyNameMap
- alias to component property name map, never nullfunction
- the function.op
- the operator.aliasRight
- the optional alias of the right property, may be nullright
- the property.
-
addWhereWithFunction
public void addWhereWithFunction(Configuration configuration, Map<String,String> aliasToEntityNameMap, Map<String,String> aliasToComponentPropertyNameMap, String aliasLeft, String left, String op, AuditFunction function)
Adds a where clause with a left (optionally aliased) property and a function call on the right side.- Parameters:
configuration
- the configuration.aliasToEntityNameMap
- alias to entity name map, never nullaliasToComponentPropertyNameMap
- alias to component property name map, never nullaliasLeft
- the optional alias of the left property, may be nullleft
- the property.op
- the operator.function
- the function.
-
addWhereWithFunction
public void addWhereWithFunction(Configuration configuration, Map<String,String> aliasToEntityNameMap, Map<String,String> aliasToComponentPropertyNameMap, AuditFunction left, String op, AuditFunction right)
Adds a where clause with a function call on both the left and right of the predicate.- Parameters:
configuration
- the configuration.aliasToEntityNameMap
- alias to entity name map, never nullaliasToComponentPropertyNameMap
- alias to component property name map, never nullleft
- the left-side function.op
- the operator.right
- the right-side function.
-
-