Module io.helidon.dbclient.mongodb
Package io.helidon.dbclient.mongodb
Class MongoDbStatementGeneric
- java.lang.Object
-
- io.helidon.dbclient.common.AbstractStatement<S,R>
-
- io.helidon.dbclient.mongodb.MongoDbStatementGeneric
-
- All Implemented Interfaces:
DbStatement<DbStatementGeneric,DbResult>,DbStatementGeneric
public class MongoDbStatementGeneric extends AbstractStatement<S,R> implements DbStatementGeneric
Generic statement for mongoDB.
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringJSON_COLLECTIONCollection JSON parameter name.protected static StringJSON_OPERATIONOperation JSON parameter name.protected static StringJSON_PROJECTIONProjection JSON parameter name: Defines projection to restrict returned fields.protected static StringJSON_QUERYQuery JSON parameter name.protected static StringJSON_VALUEValue JSON parameter name.protected static javax.json.JsonReaderFactoryREADER_FACTORYJSON reader factory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DbMapperManagerdbMapperManager()Db mapper manager.protected StringdbType()Type of this database to use in interceptor context.protected CompletionStage<DbResult>doExecute(CompletionStage<DbInterceptorContext> dbContextFuture, CompletableFuture<Void> statementFuture, CompletableFuture<Long> queryFuture)Execute the statement against the database.CompletionStage<DbResult>execute()Execute this statement using the parameters configured withparamsandaddParamsmethods.protected MapperManagermapperManager()Mapper manager.StringstatementName()Statement name.-
Methods inherited from class io.helidon.dbclient.common.AbstractStatement
addParam, addParam, indexedParam, indexedParams, me, namedParam, namedParams, params, params, paramType, statement, statementType, 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 javax.json.JsonReaderFactory READER_FACTORY
JSON reader factory.
-
-
Method Detail
-
execute
public CompletionStage<DbResult> execute()
Description copied from interface:DbStatementExecute this statement using the parameters configured withparamsandaddParamsmethods.- Specified by:
executein interfaceDbStatement<DbStatementGeneric,DbResult>- Overrides:
executein classAbstractStatement<DbStatementGeneric,DbResult>- Returns:
- The future with result of this statement, as soon as the statement is executed; note that for queries this is before the results are actually obtained from the database
-
doExecute
protected CompletionStage<DbResult> doExecute(CompletionStage<DbInterceptorContext> dbContextFuture, CompletableFuture<Void> statementFuture, CompletableFuture<Long> queryFuture)
Description copied from class:AbstractStatementExecute the statement against the database.- Specified by:
doExecutein classAbstractStatement<DbStatementGeneric,DbResult>- Parameters:
dbContextFuture- future that completes after all interceptors 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.
-
statementName
public String statementName()
Statement name.- Overrides:
statementNamein classAbstractStatement<S extends DbStatement<S,R>,R>- Returns:
- name of this statement (never null, may be generated)
-
dbMapperManager
protected DbMapperManager dbMapperManager()
Db mapper manager.- Overrides:
dbMapperManagerin classAbstractStatement<S extends DbStatement<S,R>,R>- Returns:
- mapper manager for DB types
-
mapperManager
protected MapperManager mapperManager()
Mapper manager.- Overrides:
mapperManagerin classAbstractStatement<S extends DbStatement<S,R>,R>- Returns:
- generic mapper manager
-
dbType
protected String dbType()
Description copied from class:AbstractStatementType of this database to use in interceptor context.- Specified by:
dbTypein classAbstractStatement<S extends DbStatement<S,R>,R>- Returns:
- type of this db
-
-