Package com.mysql.cj.xdevapi
Class AddStatementImpl
java.lang.Object
com.mysql.cj.xdevapi.AddStatementImpl
- All Implemented Interfaces:
AddStatement,Statement<AddStatement,AddResult>
public class AddStatementImpl extends java.lang.Object implements AddStatement
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.mysql.cj.xdevapi.Statement
Statement.LockContention -
Method Summary
Modifier and Type Method Description AddStatementadd(DbDoc... docs)Add a sequence of DbDocs.AddStatementadd(java.lang.String jsonString)Add a document as a JSON string.AddResultexecute()Execute the statement synchronously.java.util.concurrent.CompletableFuture<AddResult>executeAsync()Execute the statement asynchronously.booleanisUpsert()Check the upsert flag.AddStatementsetUpsert(boolean upsert)Set upsert flag on this statement.
-
Method Details
-
add
Description copied from interface:AddStatementAdd a document as a JSON string.- Specified by:
addin interfaceAddStatement- Parameters:
jsonString- document as a JSON string- Returns:
AddStatement
-
add
Description copied from interface:AddStatementAdd a sequence of DbDocs.- Specified by:
addin interfaceAddStatement- Parameters:
docs- one or moreDbDocdocuments- Returns:
AddStatement
-
execute
Description copied from interface:StatementExecute the statement synchronously.- Specified by:
executein interfaceStatement<AddStatement,AddResult>- Returns:
- result of statement execution
-
executeAsync
Description copied from interface:StatementExecute the statement asynchronously.- Specified by:
executeAsyncin interfaceStatement<AddStatement,AddResult>- Returns:
CompletableFuturefor result
-
isUpsert
public boolean isUpsert()Description copied from interface:AddStatementCheck the upsert flag.- Specified by:
isUpsertin interfaceAddStatement- Returns:
- true if this is an upsert statement.
-
setUpsert
Description copied from interface:AddStatementSet upsert flag on this statement. Used internally by theCollection.addOrReplaceOne(String, DbDoc)method.- Specified by:
setUpsertin interfaceAddStatement- Parameters:
upsert- if true then this statement will be executed as an upsert statement- Returns:
AddStatement
-