Package io.inversion.query
Class Where<T extends Where,P extends Query>
- java.lang.Object
-
- io.inversion.query.Builder<T,P>
-
- io.inversion.query.Where<T,P>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanaddTerm(java.lang.String token, io.inversion.rql.Term term)OVERRIDE ME TO ADD CUSTOM FUNCTIONALITY TO YOUR FLUENT APIjava.util.List<io.inversion.rql.Term>getFilters()protected booleanisInvalidColumn(Collection collection, java.lang.String column)protected booleanisInvalidColumn(io.inversion.rql.Term t)Checks to see if a column referenced by a function call is valid.protected io.inversion.rql.Termtransform(io.inversion.rql.Term parent)-
Methods inherited from class io.inversion.query.Builder
clearFunctions, find, find, findAll, findAll, findInt, findTerm, getBuilders, getParent, getRoot, getTerms, isFunction, parse, r, removeBuilder, toString, toString, withBuilder, withFunctions, withFunctions, withParent, withTerm, withTerm, withTerm, withTerms
-
-
-
-
Constructor Detail
-
Where
public Where(P query)
-
-
Method Detail
-
addTerm
protected boolean addTerm(java.lang.String token, io.inversion.rql.Term term)Description copied from class:BuilderOVERRIDE ME TO ADD CUSTOM FUNCTIONALITY TO YOUR FLUENT API
-
isInvalidColumn
protected boolean isInvalidColumn(io.inversion.rql.Term t)
Checks to see if a column referenced by a function call is valid.This function only validates the first leaf child of the supplied token in (FUNCTIN(COLUMN,...) format) and does not recurse.
To be considered valid the column name must match a Collection Properties' column name OR the Collection must be null and the column name must only contain alphanumeric characters and underscores and can not start with an underscore.
For example:
- in(COLUMN_NAME,1,2,3,4,5) - returns false if the collection has a property with the column name or if the collection is null
- in(COLUMN-NAME,1,2,3,4,5) - returns false only if the collection has a property with the column name
- in(_COLUMN_NAME,1,2,3,4,5) - returns false only if the collection has a property with the column name
- 'like' - any single token will return false as it is not in the FUNCTION(COLUMN,...) format
- or(eq(COLUMN_NAME,5), eq(COLUMN_NAME, 10)) - will return false as it si not on FUNCTION(COLUMN,...) format
IMPLEMENTATION NOTE: You may want to override this if you are using a document store (such as Azure Cosmos) that does not require each column to be defined.
IMPLEMENTATION NOTE: Terms that are passed into this function presumably have already been filtered by the Db object for known restricted columns.
- Parameters:
t- the term to check for valid column references- Returns:
- false if the first child is a leaf with an invalid column name
-
isInvalidColumn
protected boolean isInvalidColumn(Collection collection, java.lang.String column)
-
transform
protected io.inversion.rql.Term transform(io.inversion.rql.Term parent)
-
getFilters
public java.util.List<io.inversion.rql.Term> getFilters()
-
-