Interface CommonInsertMapper<T>
- Type Parameters:
T
- the type of row associated with this mapper
- All Superinterfaces:
CommonGeneralInsertMapper
This is a general purpose mapper for executing various types of insert statements. This mapper is appropriate for
insert statements that do NOT expect generated keys.
-
Method Summary
Modifier and TypeMethodDescriptionList
<org.apache.ibatis.executor.BatchResult> flush()
Flush batched insert statements and return details of the current batch.int
insert
(InsertStatementProvider<T> insertStatement) Execute an insert statement with input fields mapped to values in a POJO.int
insertMultiple
(MultiRowInsertStatementProvider<T> insertStatement) Execute an insert statement that inserts multiple rows.Methods inherited from interface org.mybatis.dynamic.sql.util.mybatis3.CommonGeneralInsertMapper
generalInsert, insertSelect
-
Method Details
-
insert
@InsertProvider(type=SqlProviderAdapter.class, method="insert") int insert(InsertStatementProvider<T> insertStatement) Execute an insert statement with input fields mapped to values in a POJO.- Parameters:
insertStatement
- the insert statement- Returns:
- the number of rows affected
-
insertMultiple
@InsertProvider(type=SqlProviderAdapter.class, method="insertMultiple") int insertMultiple(MultiRowInsertStatementProvider<T> insertStatement) Execute an insert statement that inserts multiple rows. The row values are supplied by mapping to values in a List of POJOs.- Parameters:
insertStatement
- the insert statement- Returns:
- the number of rows affected
-
flush
Flush batched insert statements and return details of the current batch. This is useful when there is no direct access to the @link(SqlSession
.- Returns:
- details about the current batch including update counts, etc.
-