Interface EntityInsertCmd<T>

Type Parameters:
T - 实体类类型
All Superinterfaces:
DaoSupplier, EntitySupplier<T>
All Known Implementing Classes:
EntityDao

public interface EntityInsertCmd<T> extends DaoSupplier, EntitySupplier<T>
实体类插入指令
Author:
Maning
  • Method Summary

    Modifier and Type
    Method
    Description
    default int
    insert(T entity)
    插入数据,若非record类型还会回填自增值(原主键值=null且标注Column(autoIncrement=true)), fill值(FillOnInsert(populate=true))
    default int
    insertBatch(List<T> entities)
    批量插入数据,batchSize由配置决定,不会对对象填充自增值
    default int
    insertBatch(List<T> entities, int batchSize)
    批量插入数据,不会对对象填充自增值
    default <S> int
    insertBatchWith(List<S> sources)
    批量插入数据通过源对象(VO,Req,DTO等,通过field匹配,需确保类型兼容),不回填数据,batchSize由配置决定
    default <S> int
    insertBatchWith(List<S> sources, int batchSize)
    批量插入数据通过源对象(VO,Req,DTO等,通过field匹配,需确保类型兼容),不回填数据
    default int
    插入数据通过源对象(VO,Req,DTO等,通过field匹配,需确保类型兼容),不回填数据
    default int
    insertWith(T entityDefault, Object source)
    插入数据通过源对象(VO,Req,DTO等,通过field匹配,需确保类型兼容),不回填数据
    default int
    插入数据通过源Map(将key当作field匹配,需确保值类型兼容)

    Methods inherited from interface DaoSupplier

    dao

    Methods inherited from interface EntitySupplier

    entityClass
  • Method Details

    • insert

      default int insert(T entity)
      插入数据,若非record类型还会回填自增值(原主键值=null且标注Column(autoIncrement=true)), fill值(FillOnInsert(populate=true))
      Parameters:
      entity - 实体类
      Returns:
      插入条数|执行结果
    • insertBatch

      default int insertBatch(List<T> entities, int batchSize)
      批量插入数据,不会对对象填充自增值
      Parameters:
      entities - 实体
      batchSize - 每次执行数量
      Returns:
      插入条数|执行结果
    • insertBatch

      default int insertBatch(List<T> entities)
      批量插入数据,batchSize由配置决定,不会对对象填充自增值
      Parameters:
      entities - 实体
      Returns:
      插入条数|执行结果
    • insertBatchWith

      default <S> int insertBatchWith(List<S> sources, int batchSize)
      批量插入数据通过源对象(VO,Req,DTO等,通过field匹配,需确保类型兼容),不回填数据
      Type Parameters:
      S - 源对象类型
      Parameters:
      sources - 要插入的对象
      batchSize - 每次执行数量
      Returns:
      插入条数|执行结果
    • insertBatchWith

      default <S> int insertBatchWith(List<S> sources)
      批量插入数据通过源对象(VO,Req,DTO等,通过field匹配,需确保类型兼容),不回填数据,batchSize由配置决定
      Type Parameters:
      S - 源对象类型
      Parameters:
      sources - 要插入的对象
      Returns:
      插入条数|执行结果
    • insertWith

      default int insertWith(Object source)
      插入数据通过源对象(VO,Req,DTO等,通过field匹配,需确保类型兼容),不回填数据
      Parameters:
      source - 源对象
      Returns:
      插入条数|执行结果
    • insertWith

      default int insertWith(T entityDefault, Object source)
      插入数据通过源对象(VO,Req,DTO等,通过field匹配,需确保类型兼容),不回填数据
      Parameters:
      entityDefault - 实体类默认值
      source - 源对象
      Returns:
      插入条数|执行结果
    • insertWithMap

      default int insertWithMap(Map<String,Object> source)
      插入数据通过源Map(将key当作field匹配,需确保值类型兼容)
      Parameters:
      source - map
      Returns:
      插入条数|执行结果