类 ModifyStatementImpl
- java.lang.Object
-
- com.mysql.cj.xdevapi.PreparableStatement<RES_T>
-
- com.mysql.cj.xdevapi.FilterableStatement<ModifyStatement,Result>
-
- com.mysql.cj.xdevapi.ModifyStatementImpl
-
- 所有已实现的接口:
ModifyStatement,Statement<ModifyStatement,Result>
public class ModifyStatementImpl extends FilterableStatement<ModifyStatement,Result> implements ModifyStatement
ModifyStatementimplementation.
-
-
嵌套类概要
-
从类继承的嵌套类/接口 com.mysql.cj.xdevapi.PreparableStatement
PreparableStatement.PreparableStatementFinalizer, PreparableStatement.PreparedState
-
从接口继承的嵌套类/接口 com.mysql.cj.xdevapi.Statement
Statement.LockContention
-
-
字段概要
-
从类继承的字段 com.mysql.cj.xdevapi.FilterableStatement
filterParams
-
从类继承的字段 com.mysql.cj.xdevapi.PreparableStatement
mysqlxSession, preparedState, preparedStatementId
-
-
方法概要
所有方法 实例方法 具体方法 已过时的方法 修饰符和类型 方法 说明 ModifyStatementarrayAppend(String docPath, Object value)Append a value to the specified array.ModifyStatementarrayInsert(String field, Object value)Insert a value into the specified array.ModifyStatementchange(String docPath, Object value)Add an update to the statement setting the field, if it exists at the document path, to the given value.CompletableFuture<Result>executeAsync()Execute the statement asynchronously.protected ResultexecutePreparedStatement()Executes a previously server-prepared statement.protected ResultexecuteStatement()Executes the statement directly (non-prepared).protected XMessagegetPrepareStatementXMessage()Returns theXMessageneeded to prepare this statement.ModifyStatementpatch(DbDoc document)Takes in a patch object and applies it on all documents matching the modify() filter, using the JSON_MERGE_PATCH() function.ModifyStatementpatch(String document)Takes in a document patch and applies it on all documents matching the modify() filter, using the JSON_MERGE_PATCH() function.ModifyStatementset(String docPath, Object value)Add an update to the statement setting the field as the document path to the given value for all documents matching the search criteria.ModifyStatementunset(String... fields)Nullify the given fields.ModifyStatementwhere(String searchCondition)已过时。Deprecated in Connector/J 8.0.17.-
从类继承的方法 com.mysql.cj.xdevapi.FilterableStatement
bind, clearBindings, isRelational, limit, offset, orderBy, sort
-
从类继承的方法 com.mysql.cj.xdevapi.PreparableStatement
deallocatePrepared, execute, getMessageBuilder, resetPrepareState, setReprepareState
-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 com.mysql.cj.xdevapi.ModifyStatement
limit, sort
-
-
-
-
方法详细资料
-
executeStatement
protected Result executeStatement()
从类复制的说明:PreparableStatementExecutes the statement directly (non-prepared). Implementation is dependent on the statement type.- 指定者:
executeStatement在类中PreparableStatement<Result>- 返回:
- the object returned from the lower level statement execution
-
getPrepareStatementXMessage
protected XMessage getPrepareStatementXMessage()
从类复制的说明:PreparableStatementReturns theXMessageneeded to prepare this statement. Implementation is dependent on the statement type.- 指定者:
getPrepareStatementXMessage在类中PreparableStatement<Result>- 返回:
- the
XMessagethat prepares this statement
-
executePreparedStatement
protected Result executePreparedStatement()
从类复制的说明:PreparableStatementExecutes a previously server-prepared statement. Implementation is dependent on the statement type.- 指定者:
executePreparedStatement在类中PreparableStatement<Result>- 返回:
- the object returned from the lower level statement execution
-
executeAsync
public CompletableFuture<Result> executeAsync()
从接口复制的说明:StatementExecute the statement asynchronously.- 指定者:
executeAsync在接口中Statement<ModifyStatement,Result>- 返回:
CompletableFuturefor result
-
set
public ModifyStatement set(String docPath, Object value)
从接口复制的说明:ModifyStatementAdd an update to the statement setting the field as the document path to the given value for all documents matching the search criteria.- 指定者:
set在接口中ModifyStatement- 参数:
docPath- document path to the given valuevalue- value to set- 返回:
ModifyStatement
-
change
public ModifyStatement change(String docPath, Object value)
从接口复制的说明:ModifyStatementAdd an update to the statement setting the field, if it exists at the document path, to the given value.- 指定者:
change在接口中ModifyStatement- 参数:
docPath- document path to the given valuevalue- value to set- 返回:
ModifyStatement
-
unset
public ModifyStatement unset(String... fields)
从接口复制的说明:ModifyStatementNullify the given fields.- 指定者:
unset在接口中ModifyStatement- 参数:
fields- one or more field names- 返回:
ModifyStatement
-
patch
public ModifyStatement patch(DbDoc document)
从接口复制的说明:ModifyStatementTakes in a patch object and applies it on all documents matching the modify() filter, using the JSON_MERGE_PATCH() function. Please note thatDbDocdoes not support expressions as a field values, please useModifyStatement.patch(String)method if you need such functionality.- 指定者:
patch在接口中ModifyStatement- 参数:
document- patch object- 返回:
ModifyStatement
-
patch
public ModifyStatement patch(String document)
从接口复制的说明:ModifyStatementTakes in a document patch and applies it on all documents matching the modify() filter, using the JSON_MERGE_PATCH() function. A document patch is similar to a JSON object, with the key difference that document field values can be nested expressions in addition to literal values.
Example:
collection.modify("_id = :id")
.patch("{\"zip\": address.zip-300000, \"street\": CONCAT($.name, '''s street: ', $.address.street)}")
.bind("id", "2").execute();- 指定者:
patch在接口中ModifyStatement- 参数:
document- patch object- 返回:
ModifyStatement
-
arrayInsert
public ModifyStatement arrayInsert(String field, Object value)
从接口复制的说明:ModifyStatementInsert a value into the specified array.- 指定者:
arrayInsert在接口中ModifyStatement- 参数:
field- document path to the array fieldvalue- value to insert- 返回:
ModifyStatement
-
arrayAppend
public ModifyStatement arrayAppend(String docPath, Object value)
从接口复制的说明:ModifyStatementAppend a value to the specified array.- 指定者:
arrayAppend在接口中ModifyStatement- 参数:
docPath- document path to the array fieldvalue- value to append- 返回:
ModifyStatement
-
where
@Deprecated public ModifyStatement where(String searchCondition)
已过时。Deprecated in Connector/J 8.0.17. Please use filter criteria in the operation starting method.从类复制的说明:FilterableStatementAdd search condition to this statement.table.delete().where("age == 13").execute();- 覆盖:
where在类中FilterableStatement<ModifyStatement,Result>- 参数:
searchCondition- expression- 返回:
- this statement
-
-