Class FilterableStatement<STMT_T,​RES_T>

java.lang.Object
com.mysql.cj.xdevapi.PreparableStatement<RES_T>
com.mysql.cj.xdevapi.FilterableStatement<STMT_T,​RES_T>
Type Parameters:
STMT_T - statement interface
RES_T - result interface
All Implemented Interfaces:
Statement<STMT_T,​RES_T>
Direct Known Subclasses:
DeleteStatementImpl, FindStatementImpl, ModifyStatementImpl, RemoveStatementImpl, SelectStatementImpl, UpdateStatementImpl

public abstract class FilterableStatement<STMT_T,​RES_T>
extends PreparableStatement<RES_T>
implements Statement<STMT_T,​RES_T>
Abstract class, common to several X DevAPI statement classes.
  • Field Details

  • Constructor Details

  • Method Details

    • where

      public STMT_T where​(java.lang.String searchCondition)
      Add search condition to this statement.
       table.delete().where("age == 13").execute();
       
      Parameters:
      searchCondition - expression
      Returns:
      this statement
    • sort

      public STMT_T sort​(java.lang.String... sortFields)
      Add sort expressions to this statement. Synonym to orderBy(String...).
       DocResult docs = this.collection.find().orderBy("$._id").execute();
       docs = this.collection.find().sort("$.x", "$.y").execute();
       
      Parameters:
      sortFields - sort expressions
      Returns:
      this statement
    • orderBy

      public STMT_T orderBy​(java.lang.String... sortFields)
      Add sort expressions to this statement.
       DocResult docs = this.collection.find().orderBy("$._id").execute();
       docs = this.collection.find().sort("$.x", "$.y").execute();
       
      Parameters:
      sortFields - sort expressions
      Returns:
      this statement
    • limit

      public STMT_T limit​(long numberOfRows)
      Add row limit to this statement.

      For example, to find only 3 rows:

       docs = this.collection.find().orderBy("$._id").limit(3).execute();
       
      Parameters:
      numberOfRows - maximum rows to process
      Returns:
      this statement
    • offset

      public STMT_T offset​(long limitOffset)
      Add maximum number of rows to skip before find others.

      For example, to skip 2 rows:

       docs = this.collection.find().orderBy("$._id").offset(2).execute();
       
      Parameters:
      limitOffset - number of rows to skip
      Returns:
      this statement
    • isRelational

      public boolean isRelational()
      Are relational columns identifiers allowed in this statement?
      Returns:
      true if allowed
    • clearBindings

      public STMT_T clearBindings()
      Description copied from interface: Statement
      Clear all bindings for this statement.
      Specified by:
      clearBindings in interface Statement<STMT_T,​RES_T>
      Returns:
      this statement
    • bind

      public STMT_T bind​(java.lang.String argName, java.lang.Object value)
      Description copied from interface: Statement
      Bind the named argument to the given value.
      Specified by:
      bind in interface Statement<STMT_T,​RES_T>
      Parameters:
      argName - argument name
      value - object to bind
      Returns:
      this statement