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 voidaddEntityTypeRestriction(String alias, String entityName)ParametersaddNegatedParameters()Adds negated parameters, by default with the "and" connective.voidaddNotNullRestriction(String propertyName, boolean addAlias)AddsIS NOT NULLrestriction.voidaddNotNullRestriction(String alias, String propertyName)AddsIS NOT NULLrestriction.voidaddNullRestriction(String propertyName, boolean addAlias)AddsIS NULLrestriction.voidaddNullRestriction(String alias, String propertyName)AddsIS NULLrestriction.ParametersaddSubParameters(String newConnective)Adds sub-parameters with a new connective.voidaddWhere(String left, boolean addAliasLeft, String op, String right, boolean addAliasRight)voidaddWhere(String left, boolean addAlias, String op, QueryBuilder right)voidaddWhere(String aliasLeft, String left, String op, String aliasRight, String right)voidaddWhere(String leftAlias, String left, String op, QueryBuilder right)voidaddWhereOrNullRestriction(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))voidaddWhereWithFunction(String alias, String left, String leftFunction, String op, Object paramValue)voidaddWhereWithFunction(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.voidaddWhereWithFunction(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.voidaddWhereWithFunction(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.voidaddWhereWithFunction(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.voidaddWhereWithNamedParam(String left, boolean addAlias, String op, String paramName)voidaddWhereWithNamedParam(String left, String op, String paramName)voidaddWhereWithParam(String left, boolean addAlias, String op, Object paramValue)voidaddWhereWithParam(String left, String op, Object paramValue)voidaddWhereWithParam(String alias, String left, String op, Object paramValue)voidaddWhereWithParams(String alias, String left, String opStart, Object[] paramValues, String opEnd)ParametersdeepCopy()
-
-
-
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 NULLrestriction.- Parameters:
propertyName- Property name.addAlias- Positive if an alias to property name shall be added.
-
addNullRestriction
public void addNullRestriction(String alias, String propertyName)
AddsIS NULLrestriction.- 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 NULLrestriction.- 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 NULLrestriction.- 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.
-
-