Package com.mysql.cj.xdevapi
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 interfaceRES_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.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.mysql.cj.xdevapi.PreparableStatement
PreparableStatement.PreparableStatementFinalizer, PreparableStatement.PreparedStateNested classes/interfaces inherited from interface com.mysql.cj.xdevapi.Statement
Statement.LockContention -
Field Summary
Fields Modifier and Type Field Description protected FilterParamsfilterParamsFields inherited from class com.mysql.cj.xdevapi.PreparableStatement
mysqlxSession, preparedState, preparedStatementId -
Constructor Summary
Constructors Constructor Description FilterableStatement(FilterParams filterParams)Constructor. -
Method Summary
Modifier and Type Method Description STMT_Tbind(java.lang.String argName, java.lang.Object value)Bind the named argument to the given value.STMT_TclearBindings()Clear all bindings for this statement.booleanisRelational()Are relational columns identifiers allowed in this statement?STMT_Tlimit(long numberOfRows)Add row limit to this statement.STMT_Toffset(long limitOffset)Add maximum number of rows to skip before find others.STMT_TorderBy(java.lang.String... sortFields)Add sort expressions to this statement.STMT_Tsort(java.lang.String... sortFields)Add sort expressions to this statement.STMT_Twhere(java.lang.String searchCondition)Add search condition to this statement.Methods inherited from class com.mysql.cj.xdevapi.PreparableStatement
deallocatePrepared, execute, executePreparedStatement, executeStatement, getMessageBuilder, getPrepareStatementXMessage, resetPrepareState, setReprepareState
-
Field Details
-
Constructor Details
-
FilterableStatement
Constructor.- Parameters:
filterParams-FilterParamsobject.
-
-
Method Details
-
where
Add search condition to this statement.table.delete().where("age == 13").execute();- Parameters:
searchCondition- expression- Returns:
- this statement
-
sort
Add sort expressions to this statement. Synonym toorderBy(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
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
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
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
Description copied from interface:StatementClear all bindings for this statement.- Specified by:
clearBindingsin interfaceStatement<STMT_T,RES_T>- Returns:
- this statement
-
bind
Description copied from interface:StatementBind the named argument to the given value.
-