public interface InsertListMapper<T>
| Modifier and Type | Method and Description |
|---|---|
int |
insertList(List<T> list)
批量插入,支持批量插入的数据库可以使用,例如MySQL,H2等
|
int |
insertListNoId(List<T> list)
批量插入,支持批量插入的数据库可以使用,例如MySQL,H2等,另外该接口限制实体包含`id`属性并且必须为自增列
|
int |
insertUseGeneratedKey(T record)
插入数据,限制为实体包含`id`属性并且必须为自增列,实体配置的主键策略无效
|
@InsertProvider(type=InsertListProvider.class, method="dynamicSQL") int insertList(List<T> list)
不支持主键策略,插入前需要设置好主键的值
list - 对象列表@Options(useGeneratedKeys=true,
keyProperty="id")
@InsertProvider(type=InsertListProvider.class,
method="dynamicSQL")
int insertListNoId(List<T> list)
list - 对象列表@Options(useGeneratedKeys=true,
keyProperty="id")
@InsertProvider(type=InsertListProvider.class,
method="dynamicSQL")
int insertUseGeneratedKey(T record)
record - 对象Copyright © 2020. All rights reserved.