Class Where<T extends Where,P extends Query>

java.lang.Object
io.inversion.rql.Builder<T,P>
io.inversion.rql.Where<T,P>

public class Where<T extends Where,P extends Query> extends Builder<T,P>
  • Constructor Details

    • Where

      public Where(P query)
  • Method Details

    • addTerm

      protected boolean addTerm(String token, Term term)
      Description copied from class: Builder
      OVERRIDE ME TO ADD CUSTOM FUNCTIONALITY TO YOUR FLUENT API
      Overrides:
      addTerm in class Builder<T extends Where,P extends Query>
      Parameters:
      token - the term to add
      term - the token of the term
      Returns:
      true if the builder or one of its child builders accepted and added the term
    • isInvalidColumn

      protected boolean isInvalidColumn(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, String column)
    • transform

      protected Term transform(Term parent)
    • getFilters

      public List<Term> getFilters()