接口 BaseMapper<T>

所有超级接口:
io.mybatis.provider.EntityInfoMapper<T>, io.mybatis.mapper.base.EntityMapper<T,Serializable>
所有已知子接口:
AbstrMapper<T>

public interface BaseMapper<T> extends io.mybatis.mapper.base.EntityMapper<T,Serializable>
  • 嵌套类概要

    从接口继承的嵌套类/接口 io.mybatis.provider.EntityInfoMapper

    io.mybatis.provider.EntityInfoMapper.CachingEntityClass
  • 方法概要

    修饰符和类型
    方法
    说明
    int
    insert(T entity)
    保存实体,默认主键自增,并且名称为 id
    default Collection<T>
    批量保存实体,需要数据库支持批量插入的语法
    int
    保存实体中不为空的字段,默认主键自增,并且名称为 id

    从接口继承的方法 io.mybatis.provider.EntityInfoMapper

    entityClass, entityTable

    从接口继承的方法 io.mybatis.mapper.base.EntityMapper

    delete, deleteByPrimaryKey, selectByPrimaryKey, selectCount, selectList, selectOne, updateByPrimaryKey, updateByPrimaryKeySelective
  • 方法详细资料

    • insert

      @Lang(io.mybatis.provider.Caching.class) @Options(useGeneratedKeys=true, keyProperty="id") @InsertProvider(type=io.mybatis.mapper.base.EntityProvider.class, method="insert") int insert(T entity)
      保存实体,默认主键自增,并且名称为 id

      这个方法是个示例,你可以在自己的接口中使用相同的方式覆盖父接口中的配置

      指定者:
      insert 在接口中 io.mybatis.mapper.base.EntityMapper<T,Serializable>
      参数:
      entity - 实体类
      返回:
      1成功,0失败
    • insertSelective

      @Lang(io.mybatis.provider.Caching.class) @Options(useGeneratedKeys=true, keyProperty="id") @InsertProvider(type=io.mybatis.mapper.base.EntityProvider.class, method="insertSelective") int insertSelective(T entity)
      保存实体中不为空的字段,默认主键自增,并且名称为 id

      这个方法是个示例,你可以在自己的接口中使用相同的方式覆盖父接口中的配置

      指定者:
      insertSelective 在接口中 io.mybatis.mapper.base.EntityMapper<T,Serializable>
      参数:
      entity - 实体类
      返回:
      1成功,0失败
    • insertList

      default Collection<T> insertList(Collection<T> records) throws APIException
      批量保存实体,需要数据库支持批量插入的语法
      参数:
      records - 实体列表
      返回:
      返回插入失败的数据列表
      抛出:
      APIException