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 AddStatement
add(DbDoc... docs)
Add a sequence of DbDocs.AddStatement
add(java.lang.String jsonString)
Add a document as a JSON string.AddResult
execute()
Execute the statement synchronously.java.util.concurrent.CompletableFuture<AddResult>
executeAsync()
Execute the statement asynchronously.boolean
isUpsert()
Check the upsert flag.AddStatement
setUpsert(boolean upsert)
Set upsert flag on this statement.
-
Method Details
-
add
Description copied from interface:AddStatement
Add a document as a JSON string.- Specified by:
add
in interfaceAddStatement
- Parameters:
jsonString
- document as a JSON string- Returns:
AddStatement
-
add
Description copied from interface:AddStatement
Add a sequence of DbDocs.- Specified by:
add
in interfaceAddStatement
- Parameters:
docs
- one or moreDbDoc
documents- Returns:
AddStatement
-
execute
Description copied from interface:Statement
Execute the statement synchronously.- Specified by:
execute
in interfaceStatement<AddStatement,AddResult>
- Returns:
- result of statement execution
-
executeAsync
Description copied from interface:Statement
Execute the statement asynchronously.- Specified by:
executeAsync
in interfaceStatement<AddStatement,AddResult>
- Returns:
CompletableFuture
for result
-
isUpsert
public boolean isUpsert()Description copied from interface:AddStatement
Check the upsert flag.- Specified by:
isUpsert
in interfaceAddStatement
- Returns:
- true if this is an upsert statement.
-
setUpsert
Description copied from interface:AddStatement
Set upsert flag on this statement. Used internally by theCollection.addOrReplaceOne(String, DbDoc)
method.- Specified by:
setUpsert
in interfaceAddStatement
- Parameters:
upsert
- if true then this statement will be executed as an upsert statement- Returns:
AddStatement
-