Class QQueryFilter
java.lang.Object
com.kingsrook.qqq.backend.core.model.actions.tables.query.QQueryFilter
- All Implemented Interfaces:
QMetaDataObject,Serializable,Cloneable
Full "filter" for a query - a list of criteria and order-bys
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enum -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCriteria(QFilterCriteria qFilterCriteria) voidaddOrderBy(QFilterOrderBy qFilterOrderBy) voidaddSubFilter(QQueryFilter subFilter) voidapplyCriteriaOptionToAllCriteria(CriteriaOptionInterface criteriaOption) clone()booleanGetter for booleanOperatorGetter for criteriagetLimit()Getter for limitGetter for ordergetSkip()Getter for skipGetter for subFiltersGetter for subFilterSetOperatorbooleanrecursively look at both this filter, and any sub-filters it may have.inthashCode()voidinterpretValues(Map<String, Serializable> inputValues) Replace any criteria values that look like ${input.XXX} with the value of XXX from the supplied inputValues map.voidinterpretValues(Map<String, Map<String, Serializable>> valueMap, FilterUseCase useCase) Replace any criteria values that look like ${input.XXX} with the value of XXX from the supplied valueMap map - where the handling of missing values is specified in the inputted FilterUseCase parameter input values is a map of maps, so that more than one 'inputValue' map can be used e.g.voidReplaces any FilterVariables' variableNames with one constructed from the field name, criteria, and index, camel stylevoidsetBooleanOperator(QQueryFilter.BooleanOperator booleanOperator) Setter for booleanOperatorvoidsetCriteria(List<QFilterCriteria> criteria) Setter for criteriavoidSetter for limitvoidsetOrderBys(List<QFilterOrderBy> orderBys) Setter for ordervoidSetter for skipvoidsetSubFilters(List<QQueryFilter> subFilters) Setter for subFiltersvoidsetSubFilterSetOperator(QQueryFilter.SubFilterSetOperator subFilterSetOperator) Setter for subFilterSetOperatortoString()withBooleanOperator(QQueryFilter.BooleanOperator booleanOperator) Fluent setter for booleanOperatorwithCriteria(QFilterCriteria qFilterCriteria) withCriteria(String fieldName, QCriteriaOperator operator, Serializable... values) fluent method to add a new criteriawithCriteria(String fieldName, QCriteriaOperator operator, Collection<? extends Serializable> values) fluent method to add a new criteriaFluent setter for limitwithOrderBy(QFilterOrderBy qFilterOrderBy) Fluent setter for skipwithSubFilter(QQueryFilter subFilter) Fluent setter for adding a single subFilterwithSubFilters(List<QQueryFilter> subFilters) Fluent setter for subFilterswithSubFilterSetOperator(QQueryFilter.SubFilterSetOperator subFilterSetOperator) Fluent setter for subFilterSetOperator
-
Constructor Details
-
QQueryFilter
public QQueryFilter()Constructor -
QQueryFilter
Constructor
-
-
Method Details
-
clone
-
hasAnyCriteria
public boolean hasAnyCriteria()recursively look at both this filter, and any sub-filters it may have. -
getCriteria
Getter for criteria -
setCriteria
Setter for criteria -
getOrderBys
Getter for order -
setOrderBys
Setter for order -
addCriteria
-
withCriteria
-
withCriteria
public QQueryFilter withCriteria(String fieldName, QCriteriaOperator operator, Collection<? extends Serializable> values) fluent method to add a new criteria -
withCriteria
public QQueryFilter withCriteria(String fieldName, QCriteriaOperator operator, Serializable... values) fluent method to add a new criteria -
addOrderBy
-
withOrderBy
-
getBooleanOperator
Getter for booleanOperator -
setBooleanOperator
Setter for booleanOperator -
withBooleanOperator
Fluent setter for booleanOperator -
getSubFilters
Getter for subFilters -
setSubFilters
Setter for subFilters -
withSubFilters
Fluent setter for subFilters -
withSubFilter
Fluent setter for adding a single subFilter -
addSubFilter
-
toString
-
prepForBackend
public void prepForBackend()Replaces any FilterVariables' variableNames with one constructed from the field name, criteria, and index, camel style -
interpretValues
Replace any criteria values that look like ${input.XXX} with the value of XXX from the supplied inputValues map. Note - it may be very important that you call this method on a clone of a QQueryFilter - e.g., if it's one that defined in metaData, and that we don't want to be (permanently) changed!! This overload does not take in a FilterUseCase - it uses FilterUseCase.DEFAULT- Throws:
QException
-
interpretValues
public void interpretValues(Map<String, Map<String, throws QExceptionSerializable>> valueMap, FilterUseCase useCase) Replace any criteria values that look like ${input.XXX} with the value of XXX from the supplied valueMap map - where the handling of missing values is specified in the inputted FilterUseCase parameter input values is a map of maps, so that more than one 'inputValue' map can be used e.g. MapBuilder.of("input", valueMap, "processValues", processValues) Note - it may be very important that you call this method on a clone of a QQueryFilter - e.g., if it's one that defined in metaData, and that we don't want to be (permanently) changed!!- Throws:
QException
-
getSkip
Getter for skip -
setSkip
Setter for skip -
withSkip
Fluent setter for skip -
getLimit
Getter for limit -
setLimit
Setter for limit -
withLimit
Fluent setter for limit -
equals
-
hashCode
-
getSubFilterSetOperator
Getter for subFilterSetOperator -
setSubFilterSetOperator
Setter for subFilterSetOperator -
withSubFilterSetOperator
public QQueryFilter withSubFilterSetOperator(QQueryFilter.SubFilterSetOperator subFilterSetOperator) Fluent setter for subFilterSetOperator -
applyCriteriaOptionToAllCriteria
-