Interface InsertCmd
- All Superinterfaces:
Executable
- All Known Implementing Classes:
Dao
-
Method Summary
Modifier and TypeMethodDescriptiondefault int插入数据,若非record类型还会回填自增值(原主键值=null且标注Column(autoIncrement=true)), fill值(FillOnInsert(populate=true))default <T> intinsertBatch(List<T> entities) 批量插入数据,batchSize由配置决定,不会对对象填充自增值default <T> intinsertBatch(List<T> entities, int batchSize) 批量插入数据,不会对对象回填自增值和fill值(不影响数据库层面自增和插入fill填)default <S> intinsertBatchWith(Class<?> entityClass, List<S> sources) 批量插入数据通过源对象(VO,Req,DTO等,通过field匹配,需确保类型兼容),不回填数据,batchSize由配置决定default <S> intinsertBatchWith(Class<?> entityClass, List<S> sources, int batchSize) 批量插入数据通过源对象(VO,Req,DTO等,通过field匹配,需确保类型兼容),不回填数据default intinsertWith(Class<?> entityClass, Object source) 插入数据通过源对象(VO,Req,DTO等,通过field匹配,需确保类型兼容),不回填数据default intinsertWith(Object entityDefault, Object source) 插入数据通过源对象(VO,Req,DTO等,通过field匹配,需确保类型兼容),不回填数据default intinsertWithMap(Class<?> entityClass, Map<String, Object> source) 插入数据通过源Map(将key当作field匹配,需确保值类型兼容)Methods inherited from interface Executable
executor, interceptor
-
Method Details
-
insert
插入数据,若非record类型还会回填自增值(原主键值=null且标注Column(autoIncrement=true)), fill值(FillOnInsert(populate=true))- Parameters:
entity- 实体类实例- Returns:
- 插入条数|执行结果
-
insertBatch
批量插入数据,不会对对象回填自增值和fill值(不影响数据库层面自增和插入fill填)- Type Parameters:
T- 实体类型- Parameters:
entities- 实体batchSize- 每次执行数量- Returns:
- 插入条数|执行结果
-
insertBatch
批量插入数据,batchSize由配置决定,不会对对象填充自增值- Type Parameters:
T- 实体类型- Parameters:
entities- 实体- Returns:
- 插入条数|执行结果
-
insertBatchWith
-
insertBatchWith
-
insertWith
-
insertWith
-
insertWithMap
-