Package io.mybatis.mapper
Interface BaseMapper<T,I extends Serializable>
-
- Type Parameters:
T- 实体类类型I- 主键类型
- All Superinterfaces:
CursorMapper<T,Example<T>>,io.mybatis.provider.EntityInfoMapper<T>,EntityMapper<T,I>,ExampleMapper<T,Example<T>>
- All Known Subinterfaces:
LogicalMapper<T,I>,Mapper<T,I>
public interface BaseMapper<T,I extends Serializable> extends EntityMapper<T,I>, ExampleMapper<T,Example<T>>, CursorMapper<T,Example<T>>
基础 Mapper 方法,可以在此基础上继承覆盖已有方法- Author:
- liuzh
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <F> intdeleteByFieldList(Fn<T,F> field, Collection<F> fieldValueList)根据指定字段集合删除:field in (fieldValueList)default <F> List<T>selectByFieldList(Fn<T,F> field, Collection<F> fieldValueList)根据指定字段集合查询:field in (fieldValueList)intupdateByPrimaryKeySelectiveWithForceFields(T entity, Fn.Fns<T> forceUpdateFields)根据主键更新实体中不为空的字段,强制字段不区分是否 null,都更新default ExampleWrapper<T,I>wrapper()Example 查询封装-
Methods inherited from interface io.mybatis.mapper.cursor.CursorMapper
selectCursor, selectCursorByExample
-
Methods inherited from interface io.mybatis.mapper.base.EntityMapper
delete, deleteByPrimaryKey, insert, insertSelective, selectByPrimaryKey, selectCount, selectList, selectOne, updateByPrimaryKey, updateByPrimaryKeySelective
-
Methods inherited from interface io.mybatis.mapper.example.ExampleMapper
countByExample, deleteByExample, example, selectByExample, selectByExample, selectOneByExample, updateByExample, updateByExampleSelective, updateByExampleSetValues
-
-
-
-
Method Detail
-
wrapper
default ExampleWrapper<T,I> wrapper()
Example 查询封装
-
updateByPrimaryKeySelectiveWithForceFields
@Lang(io.mybatis.provider.Caching.class) @UpdateProvider(type=FnProvider.class, method="updateByPrimaryKeySelectiveWithForceFields") int updateByPrimaryKeySelectiveWithForceFields(@Param("entity") T entity, @Param("fns") Fn.Fns<T> forceUpdateFields)
根据主键更新实体中不为空的字段,强制字段不区分是否 null,都更新当前方法来自
FnMapper,该接口中的其他方法用ExampleMapper也能实现- Parameters:
entity- 实体类forceUpdateFields- 强制更新的字段,不区分字段是否为 null,通过Fn.of(Fn...)创建Fn.Fns- Returns:
- 1成功,0失败
-
selectByFieldList
default <F> List<T> selectByFieldList(Fn<T,F> field, Collection<F> fieldValueList)
根据指定字段集合查询:field in (fieldValueList)这个方法是个示例,你也可以使用 Java8 的默认方法实现一些通用方法
- Type Parameters:
F- 字段类型- Parameters:
field- 字段fieldValueList- 字段值集合- Returns:
- 实体列表
-
deleteByFieldList
default <F> int deleteByFieldList(Fn<T,F> field, Collection<F> fieldValueList)
根据指定字段集合删除:field in (fieldValueList)这个方法是个示例,你也可以使用 Java8 的默认方法实现一些通用方法
- Type Parameters:
F- 字段类型- Parameters:
field- 字段fieldValueList- 字段值集合- Returns:
- 实体列表
-
-