Class IckleQueryOperators
- java.lang.Object
- 
- org.keycloak.models.map.storage.hotRod.IckleQueryOperators
 
- 
 public class IckleQueryOperators extends Object This class provides knowledge on how to build Ickle query where clauses for specifiedModelCriteriaBuilder.Operator. For example, for operatorModelCriteriaBuilder.Operator.EQwe concatenate left operand and right operand with equal sign:fieldName = :parameterNamehowever, for operatorModelCriteriaBuilder.Operator.EXISTSwe add following:fieldName IS NOT NULL AND fieldName IS NOT EMPTY". For right side operands we use named parameters to avoid injection attacks. Mapping between named parameter and corresponding value is then saved intoMap<String, Object>that is passed to eachIckleQueryOperators.ExpressionCombinator.
- 
- 
Constructor SummaryConstructors Constructor Description IckleQueryOperators()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static StringcombineExpressions(ModelCriteriaBuilder.Operator op, String modelFieldName, Object[] values, Map<String,Object> parameters)Provides a string containing where clause for given operator, field name and valuesstatic StringfindAvailableNamedParam(Set<String> existingNames, String namePrefix)MapsnamePrefixto next available parameter name.
 
- 
- 
- 
Field Detail- 
Cpublic static final String C - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
findAvailableNamedParampublic static String findAvailableNamedParam(Set<String> existingNames, String namePrefix) MapsnamePrefixto next available parameter name. For example, ifnamePrefix == "id"andexistingNamesset already containsid0andid1it returnsid2. Any character that is not an alphanumeric will be stripped, so that it works for prefixes like"attributes.name"as well. This method is used for computing available names for name query parameters. Instead of creating generic named parameters that would be hard to debug and read by humans, it creates readable named parameters from the prefix.- Parameters:
- existingNames- set of parameter names that are already used in this Ickle query
- namePrefix- name of the parameter
- Returns:
- next available parameter name
 
 - 
combineExpressionspublic static String combineExpressions(ModelCriteriaBuilder.Operator op, String modelFieldName, Object[] values, Map<String,Object> parameters) Provides a string containing where clause for given operator, field name and values- Parameters:
- op- operator
- modelFieldName- field name
- values- values
- parameters- mapping between named parameters and their values
- Returns:
- where clause
 
 
- 
 
-