Interface DbStatementDml
- All Superinterfaces:
DbStatement<DbStatementDml>
- All Known Implementing Classes:
MongoDbStatementDml
Data Manipulation Language (DML) database statement.
A DML statement modifies records in the database and returns the number of modified records.
-
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 usinginsert().Set auto-generated keys to be returned from the statement execution usinginsert().Methods inherited from interface DbStatement
addParam, addParam, addParam, addParam, addParam, addParam, addParam, addParam, addParam, addParam, addParam, addParam, addParam, addParam, addParam, addParam, addParam, addParam, addParam, addParam, addParam, addParam, addParam, addParam, indexedParam, namedParam, params, 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.indexedParam(Object parameters) Configure parameters usingObjectinstance with registered mapper.namedParam(Object parameters) Configure parameters usingObjectinstance with registered mapper.default DbStatementDmlConfigure parameters from an array by order.Configure parameters from aListby order.Configure named parameters.
-
Method Details
-
execute
long execute()Execute this statement using the parameters configured withparamsandaddParamsmethods.- Returns:
- the result of this statement
-
insert
DbResultDml insert()ExecuteINSERTstatement using the parameters configured withparamsandaddParamsmethods and return compound result with generated keys.- Returns:
- the result of this statement with generated keys
-
returnGeneratedKeys
DbStatementDml returnGeneratedKeys()Set auto-generated keys to be returned from the statement execution usinginsert(). Only one method fromreturnGeneratedKeys()andreturnColumns(List)may be used. This feature is database provider specific and some databases require specific columns to be set.- Returns:
- updated db statement
-
returnColumns
Set column names to be returned from the inserted row or rows from the statement execution usinginsert(). Only one method fromreturnGeneratedKeys()andreturnColumns(List)may be used. This feature is database provider specific.- Parameters:
columnNames- an array of column names indicating the columns that should be returned from the inserted row or rows- Returns:
- updated db statement
-