接口 BaseMapper<T>
- 所有超级接口:
io.mybatis.provider.EntityInfoMapper<T>,io.mybatis.mapper.base.EntityMapper<T,Serializable>
- 所有已知子接口:
AbstrMapper<T>
-
嵌套类概要
从接口继承的嵌套类/接口 io.mybatis.provider.EntityInfoMapper
io.mybatis.provider.EntityInfoMapper.CachingEntityClass -
方法概要
修饰符和类型方法说明int保存实体,默认主键自增,并且名称为 iddefault Collection<T>insertList(Collection<T> records) 批量保存实体,需要数据库支持批量插入的语法intinsertSelective(T entity) 保存实体中不为空的字段,默认主键自增,并且名称为 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
批量保存实体,需要数据库支持批量插入的语法- 参数:
records- 实体列表- 返回:
- 返回插入失败的数据列表
- 抛出:
APIException
-