- java.lang.Object
-
- io.helidon.dbclient.common.AbstractStatement<S,R>
-
- io.helidon.dbclient.mongodb.MongoDbStatementDml
-
- All Implemented Interfaces:
DbStatement<DbStatementDml,Single<Long>>
,DbStatementDml
public class MongoDbStatementDml extends AbstractStatement<S,R> implements DbStatementDml
DML statement for MongoDB.
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
JSON_COLLECTION
Collection JSON parameter name.protected static String
JSON_OPERATION
Operation JSON parameter name.protected static String
JSON_PROJECTION
Projection JSON parameter name: Defines projection to restrict returned fields.protected static String
JSON_QUERY
Query JSON parameter name.protected static String
JSON_VALUE
Value JSON parameter name.protected static JsonReaderFactory
READER_FACTORY
JSON reader factory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
dbType()
Type of this database to use in interceptor context.protected Single<Long>
doExecute(Single<DbClientServiceContext> dbContext, CompletableFuture<Void> statementFuture, CompletableFuture<Long> queryFuture)
Execute the statement against the database.Single<Long>
execute()
Execute this statement using the parameters configured withparams
andaddParams
methods.String
statementName()
Statement name.protected DbStatementType
statementType()
Type of this statement.-
Methods inherited from class io.helidon.dbclient.common.AbstractStatement
addParam, addParam, clientContext, dbMapperManager, indexedParam, indexedParams, mapperManager, me, namedParam, namedParams, params, params, paramType, statement, update
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.helidon.dbclient.DbStatement
addParam, addParam, indexedParam, namedParam, params, params, params
-
-
-
-
Field Detail
-
JSON_OPERATION
protected static final String JSON_OPERATION
Operation JSON parameter name.- See Also:
- Constant Field Values
-
JSON_COLLECTION
protected static final String JSON_COLLECTION
Collection JSON parameter name.- See Also:
- Constant Field Values
-
JSON_QUERY
protected static final String JSON_QUERY
Query JSON parameter name.- See Also:
- Constant Field Values
-
JSON_VALUE
protected static final String JSON_VALUE
Value JSON parameter name.- See Also:
- Constant Field Values
-
JSON_PROJECTION
protected static final String JSON_PROJECTION
Projection JSON parameter name: Defines projection to restrict returned fields.- See Also:
- Constant Field Values
-
READER_FACTORY
protected static final JsonReaderFactory READER_FACTORY
JSON reader factory.
-
-
Method Detail
-
execute
public Single<Long> execute()
Description copied from interface:DbStatement
Execute this statement using the parameters configured withparams
andaddParams
methods.- Specified by:
execute
in interfaceDbStatement<DbStatementDml,Single<Long>>
- Overrides:
execute
in classAbstractStatement<DbStatementDml,Single<Long>>
- Returns:
- The result of this statement, never blocking.
-
doExecute
protected Single<Long> doExecute(Single<DbClientServiceContext> dbContext, CompletableFuture<Void> statementFuture, CompletableFuture<Long> queryFuture)
Description copied from class:AbstractStatement
Execute the statement against the database.- Specified by:
doExecute
in classAbstractStatement<DbStatementDml,Single<Long>>
- Parameters:
dbContext
- future that completes after all services are invokedstatementFuture
- future that should complete when the statement finishes executionqueryFuture
- future that should complete when the result set is fully read (if one exists), otherwise complete same as statementFuture- Returns:
- result of this db statement.
-
statementType
protected DbStatementType statementType()
Description copied from class:AbstractStatement
Type of this statement.- Overrides:
statementType
in classAbstractStatement<DbStatementDml,Single<Long>>
- Returns:
- statement type
-
statementName
public String statementName()
Statement name.- Overrides:
statementName
in classAbstractStatement<S extends DbStatement<S,R>,R>
- Returns:
- name of this statement (never null, may be generated)
-
dbType
protected String dbType()
Description copied from class:AbstractStatement
Type of this database to use in interceptor context.- Specified by:
dbType
in classAbstractStatement<S extends DbStatement<S,R>,R>
- Returns:
- type of this db
-
-