Class MongoDbStatementDml
- All Implemented Interfaces:
DbStatement<DbStatementDml>, DbStatementDml
MongoDB
DbStatementDml implementation.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final StringCollection JSON parameter name.protected static final StringOperation JSON parameter name.protected static final StringProjection JSON parameter name: Defines projection to restrict returned fields.protected static final StringQuery JSON parameter name.protected static final StringValue JSON parameter name. -
Method Summary
Modifier and TypeMethodDescriptionlongexecute()Execute this statement using the parameters configured withparamsandaddParamsmethods.insert()ExecuteINSERTstatement using the parameters configured withparamsandaddParamsmethods and return compound result with generated keys.returnColumns(List<String> columnNames) Set column names to be returned from the inserted row or rows from the statement execution usingDbStatementDml.insert().Set auto-generated keys to be returned from the statement execution usingDbStatementDml.insert().Get the statement type.Methods inherited from class DbStatementBase
addParam, addParam, addParam, addParam, addParam, addParam, addParam, addParam, addParam, addParam, addParam, addParam, addParam, addParam, addParam, addParam, addParam, addParam, addParam, addParam, addParam, addParam, addParam, addParam, autoClose, context, context, doExecute, identity, indexedParam, namedParam, parameters, params, paramsModifier and TypeMethodDescriptionaddParam(boolean parameter) Add next boolean parameter to the list of ordered parameters (e.g.addParam(byte parameter) Add next byte parameter to the list of ordered parameters (e.g.addParam(byte[] parameter) Add next byte[] parameter to the list of ordered parameters (e.g.addParam(double parameter) Add next double parameter to the list of ordered parameters (e.g.addParam(float parameter) Add next float parameter to the list of ordered parameters (e.g.addParam(int parameter) Add next integer parameter to the list of ordered parameters (e.g.addParam(long parameter) Add next long parameter to the list of ordered parameters (e.g.addParam(short parameter) Add next short parameter to the list of ordered parameters (e.g.Add next parameter to the list of ordered parameters (e.g.Add nextStringparameter to the list of ordered parameters (e.g.Add next boolean parameter to the map of named parameters (e.g.Add next byte parameter to the map of named parameters (e.g.Add next byte[] parameter to the map of named parameters (e.g.Add next double parameter to the map of named parameters (e.g.Add next float parameter to the map of named parameters (e.g.Add next int parameter to the map of named parameters (e.g.Add next long parameter to the map of named parameters (e.g.Add next short parameter to the map of named parameters (e.g.Add next parameter to the map of named parameters (e.g.Add nextStringparameter to the map of named parameters (e.g.addParam(String name, BigDecimal parameter) Add nextBigDecimalparameter to the map of named parameters (e.g.addParam(String name, BigInteger parameter) Add nextBigIntegerparameter to the map of named parameters (e.g.addParam(BigDecimal parameter) Add nextBigDecimalparameter to the list of ordered parameters (e.g.addParam(BigInteger parameter) Add nextBigIntegerparameter to the list of ordered parameters (e.g.protected static <T> Stream<T> Decorate the given stream to invokeBaseStream.close()on terminal operations.context()Get the execution context.protected <C extends DbExecuteContext>
CReturns execution context cast to it's extending class.protected <T> TdoExecute(BiFunction<CompletableFuture<Long>, DbClientServiceContext, T> function) Execute the statement with interception.protected DbStatementDmlidentity()Get this instance as the correct type.indexedParam(Object parameters) Configure parameters usingObjectinstance with registered mapper.namedParam(Object parameters) Configure parameters usingObjectinstance with registered mapper.Get the statement parameters.Configure parameters from aListby order.Configure named parameters.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface DbStatement
paramsModifier and TypeMethodDescriptiondefault DbStatementDmlConfigure parameters from an array by order.
-
Field Details
-
JSON_OPERATION
-
JSON_COLLECTION
-
JSON_QUERY
-
JSON_VALUE
-
JSON_PROJECTION
Projection JSON parameter name: Defines projection to restrict returned fields.- See Also:
-
-
Method Details
-
statementType
Description copied from class:DbStatementBaseGet the statement type.- Specified by:
statementTypein classDbStatementBase<DbStatementDml>- Returns:
- statement type
-
execute
public long execute()Description copied from interface:DbStatementDmlExecute this statement using the parameters configured withparamsandaddParamsmethods.- Specified by:
executein interfaceDbStatementDml- Returns:
- the result of this statement
-
insert
Description copied from interface:DbStatementDmlExecuteINSERTstatement using the parameters configured withparamsandaddParamsmethods and return compound result with generated keys.- Specified by:
insertin interfaceDbStatementDml- Returns:
- the result of this statement with generated keys
-
returnGeneratedKeys
Description copied from interface:DbStatementDmlSet auto-generated keys to be returned from the statement execution usingDbStatementDml.insert(). Only one method fromDbStatementDml.returnGeneratedKeys()andDbStatementDml.returnColumns(List)may be used. This feature is database provider specific and some databases require specific columns to be set.- Specified by:
returnGeneratedKeysin interfaceDbStatementDml- Returns:
- updated db statement
-
returnColumns
Description copied from interface:DbStatementDmlSet column names to be returned from the inserted row or rows from the statement execution usingDbStatementDml.insert(). Only one method fromDbStatementDml.returnGeneratedKeys()andDbStatementDml.returnColumns(List)may be used. This feature is database provider specific.- Specified by:
returnColumnsin interfaceDbStatementDml- Parameters:
columnNames- an array of column names indicating the columns that should be returned from the inserted row or rows- Returns:
- updated db statement
-