Interface FilterParams

All Known Implementing Classes:
AbstractFilterParams, DocFilterParams, TableFilterParams

public interface FilterParams
Transforms X DevAPI filter parameters into X Protocol message entities. Used internally.
  • Method Details

    • getCollection

      java.lang.Object getCollection()
      Get X Protocol Collection object.
      Returns:
      X Protocol Collection object
    • getOrder

      java.lang.Object getOrder()
      Get X Protocol Order objects.
      Returns:
      List of X Protocol Order objects
    • setOrder

      void setOrder​(java.lang.String... orderExpression)
      Parse order expressions into X Protocol Order objects.
       DocResult docs = this.collection.find().orderBy("$._id").execute();
       docs = this.collection.find().sort("$.x", "$.y").execute();
       
      Parameters:
      orderExpression - order expressions
    • getLimit

      java.lang.Long getLimit()
      Get max number of rows to filter.
      Returns:
      limit
    • setLimit

      void setLimit​(java.lang.Long limit)
      Set maximum rows to find.

      For example, to find the 3 first rows:

       docs = this.collection.find().orderBy("$._id").limit(3).execute();
       
      Parameters:
      limit - maximum rows to find
    • getOffset

      java.lang.Long getOffset()
      Get number of rows to skip before finding others.
      Returns:
      maximum rows to skip
    • setOffset

      void setOffset​(java.lang.Long offset)
      Set number of rows to skip before finding others.

      For example, to skip 1 row and find other 3 rows:

       docs = this.collection.find().orderBy("$._id").limit(3).skip(1).execute();
       
      Parameters:
      offset - maximum rows to skip
    • supportsOffset

      boolean supportsOffset()
      Whether offset clause is supported in the statement or not.

      Note that setting offset values is always possible, even if they are not supported.

      Returns:
      true if offset clause is supported
    • getCriteria

      java.lang.Object getCriteria()
      Get the search criteria.
      Returns:
      X Protocol Expr object
    • setCriteria

      void setCriteria​(java.lang.String criteriaString)
      Parse criteriaString into X Protocol Expr object.
       docs = this.collection.find("$.x1 = 29 | 15").execute();
       table.delete().where("age == 13").execute();
       
      Parameters:
      criteriaString - expression
    • getArgs

      java.lang.Object getArgs()
      Get binding arguments.
      Returns:
      List of X Protocol Scalar object
    • addArg

      void addArg​(java.lang.String name, java.lang.Object value)
      Set binding.
       this.collection.find("a = :arg1 or b = :arg2").bind("arg1", 1).bind("arg2", 2).execute();
       
      Parameters:
      name - bind key
      value - bind value
    • verifyAllArgsBound

      void verifyAllArgsBound()
      Verify that all arguments are bound. Throws WrongArgumentException if any placeholder argument is not bound.
    • clearArgs

      void clearArgs()
      Remove all current bindings.
    • isRelational

      boolean isRelational()
      Are relational columns identifiers allowed?
      Returns:
      true if allowed
    • setFields

      void setFields​(java.lang.String... projection)
      Parse projection expressions into X Protocol Projection objects.
       collection.find().fields("CAST($.x as SIGNED) as x").execute();
       table.select("_id, name, birthday, age").execute();
       table.select("age as age_group, count(name) as cnt, something").execute();
       
      Parameters:
      projection - projection expression
    • getFields

      java.lang.Object getFields()
      Get X Protocol Projection objects.
      Returns:
      List of X Protocol Projection objects.
    • setGrouping

      void setGrouping​(java.lang.String... groupBy)
      Parse groupBy expressions into X Protocol Expr objects.
       SelectStatement stmt = table.select("age as age_group, count(name) as cnt, something");
       stmt.groupBy("something", "age_group");
       
      Parameters:
      groupBy - groupBy expression
    • getGrouping

      java.lang.Object getGrouping()
      Get X Protocol Expr objects for groupBy.
      Returns:
      List of X Protocol Expr objects
    • setGroupingCriteria

      void setGroupingCriteria​(java.lang.String having)
      Parse having expressions into X Protocol Expr objects.
       SelectStatement stmt = table.select("age as age_group, count(name) as cnt, something");
       stmt.groupBy("something", "age_group");
       stmt.having("cnt > 1");
       
      Parameters:
      having - having expression
    • getGroupingCriteria

      java.lang.Object getGroupingCriteria()
      Get X Protocol Expr objects for grouping criteria.
      Returns:
      List of X Protocol Expr objects
    • getLock

      Returns:
      FilterParams.RowLock
    • setLock

      void setLock​(FilterParams.RowLock rowLock)
      Parameters:
      rowLock - FilterParams.RowLock
    • getLockOption

      Returns:
      FilterParams.RowLockOptions
    • setLockOption

      void setLockOption​(FilterParams.RowLockOptions rowLockOption)
      Parameters:
      rowLockOption - FilterParams.RowLockOptions