接口 FilterParams

    • 方法详细资料

      • getCollection

        Object getCollection()
        Get X Protocol Collection object.
        返回:
        X Protocol Collection object
      • getOrder

        Object getOrder()
        Get X Protocol Order objects.
        返回:
        List of X Protocol Order objects
      • setOrder

        void setOrder​(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();
         
        参数:
        orderExpression - order expressions
      • getLimit

        Long getLimit()
        Get max number of rows to filter.
        返回:
        limit
      • setLimit

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

        For example, to find the 3 first rows:

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

        Long getOffset()
        Get number of rows to skip before finding others.
        返回:
        maximum rows to skip
      • setOffset

        void setOffset​(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();
         
        参数:
        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.

        返回:
        true if offset clause is supported
      • getCriteria

        Object getCriteria()
        Get the search criteria.
        返回:
        X Protocol Expr object
      • setCriteria

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

        Object getArgs()
        Get binding arguments.
        返回:
        List of X Protocol Scalar object
      • addArg

        void addArg​(String name,
                    Object value)
        Set binding.
         this.collection.find("a = :arg1 or b = :arg2").bind("arg1", 1).bind("arg2", 2).execute();
         
        参数:
        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?
        返回:
        true if allowed
      • setFields

        void setFields​(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();
         
        参数:
        projection - projection expression
      • getFields

        Object getFields()
        Get X Protocol Projection objects.
        返回:
        List of X Protocol Projection objects.
      • setGrouping

        void setGrouping​(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");
         
        参数:
        groupBy - groupBy expression
      • getGrouping

        Object getGrouping()
        Get X Protocol Expr objects for groupBy.
        返回:
        List of X Protocol Expr objects
      • setGroupingCriteria

        void setGroupingCriteria​(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");
         
        参数:
        having - having expression
      • getGroupingCriteria

        Object getGroupingCriteria()
        Get X Protocol Expr objects for grouping criteria.
        返回:
        List of X Protocol Expr objects