Class InExpressionBuilder
java.lang.Object
com.atlassian.confluence.impl.hibernate.query.InExpressionBuilder
Builder for dealing with query strings using the IN clause (or NOT IN clause).
Some database dialects have limits and need to be handled specifically.
- Since:
- 6.4.1
-
Method Summary
Modifier and TypeMethodDescriptionIf required, split up the IN/NOT-IN expression into smaller partitions which are within the IN clause limitations.Convert a list of Long into an an expression which is within the IN clause limitations we are working around.static InExpressionBuilder
getInExpressionBuilderCustomLimit
(String fieldName, String parameterName, List<String> parameterValues, int inExpressionLimit) static InExpressionBuilder
getInExpressionBuilderDefaultLimit
(String fieldName, String parameterName, List<String> parameterValues, org.hibernate.dialect.Dialect dialect) static InExpressionBuilder
getInExpressionBuilderDefaultLimit
(String fieldName, String parameterName, org.hibernate.dialect.Dialect dialect) static InExpressionBuilder
getNotInExpressionBuilderCustomLimit
(String fieldName, String parameterName, List<String> parameterValues, int inExpressionLimit) static InExpressionBuilder
getNotInExpressionBuilderDefaultLimit
(String fieldName, String parameterName, List<String> parameterValues, org.hibernate.dialect.Dialect dialect) static InExpressionBuilder
getNotInExpressionBuilderDefaultLimit
(String fieldName, String parameterName, org.hibernate.dialect.Dialect dialect) void
substituteInExpressionParameters
(org.hibernate.query.Query query) Takes in a Query and substitutes actual values into the parameter lists, according to the IN clause limitations.
-
Method Details
-
getInExpressionBuilderDefaultLimit
public static InExpressionBuilder getInExpressionBuilderDefaultLimit(String fieldName, String parameterName, List<String> parameterValues, org.hibernate.dialect.Dialect dialect) -
getInExpressionBuilderCustomLimit
public static InExpressionBuilder getInExpressionBuilderCustomLimit(String fieldName, String parameterName, List<String> parameterValues, int inExpressionLimit) -
getInExpressionBuilderDefaultLimit
public static InExpressionBuilder getInExpressionBuilderDefaultLimit(String fieldName, String parameterName, org.hibernate.dialect.Dialect dialect) -
getNotInExpressionBuilderDefaultLimit
public static InExpressionBuilder getNotInExpressionBuilderDefaultLimit(String fieldName, String parameterName, List<String> parameterValues, org.hibernate.dialect.Dialect dialect) -
getNotInExpressionBuilderCustomLimit
public static InExpressionBuilder getNotInExpressionBuilderCustomLimit(String fieldName, String parameterName, List<String> parameterValues, int inExpressionLimit) -
getNotInExpressionBuilderDefaultLimit
public static InExpressionBuilder getNotInExpressionBuilderDefaultLimit(String fieldName, String parameterName, org.hibernate.dialect.Dialect dialect) -
buildInExpressionString
If required, split up the IN/NOT-IN expression into smaller partitions which are within the IN clause limitations.- Returns:
- The expression modified into smaller partitions if required. If list is empty, simply returns an expression that is always true/false depending on the clause type.
-
convertIdsToInClauseString
Convert a list of Long into an an expression which is within the IN clause limitations we are working around. This method does not bind any parameters, it simply creates the IN clause as a String. We shouldn't use this method for String input because of potential security issues, so it takes in Longs (IDs) only.- Returns:
- The list of Long modified into smaller partitions if required. If list is empty, simply returns an expression that is always true/false depending on the clause type.
-
substituteInExpressionParameters
public void substituteInExpressionParameters(org.hibernate.query.Query query) Takes in a Query and substitutes actual values into the parameter lists, according to the IN clause limitations.- Parameters:
query
- The query to substitute actual parameter values into.
-