Module bus.mapper
Package org.miaixz.bus.mapper.binding
Interface BasicMapper<T,I extends Serializable>
- Type Parameters:
T- 实体类类型I- 主键类型
- All Superinterfaces:
ClassMapper<T>,ConditionMapper<T,,Condition<T>> CursorMapper<T,,Condition<T>> EntityMapper<T,I>
- All Known Subinterfaces:
LogicalMapper<T,,I> Mapper<T,I>
public interface BasicMapper<T,I extends Serializable>
extends EntityMapper<T,I>, ConditionMapper<T,Condition<T>>, CursorMapper<T,Condition<T>>
基础 Mapper 接口,集成常用操作方法,支持继承和方法覆盖
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.miaixz.bus.mapper.binding.basic.ClassMapper
ClassMapper.CachingEntityClass -
Method Summary
Modifier and TypeMethodDescriptiondefault <F> intdeleteByFieldList(Fn<T, F> field, Collection<F> fieldValueList) 根据指定字段集合删除,条件为 field IN (fieldValueList)selectByFieldList(Fn<T, F> field, Collection<F> fieldValueList) 根据指定字段集合查询,条件为 field IN (fieldValueList)<S extends T>
intupdateByPrimaryKeySelectiveWithForceFields(S entity, Fn.FnArray<T> fields) 根据主键更新实体中非空字段,并强制更新指定字段<S extends T>
intupdateForFieldListByPrimaryKey(S entity, Fn.FnArray<T> fields) 根据主键更新指定字段集合default ConditionWrapper<T, I> wrapper()创建 Condition 查询封装对象Methods inherited from interface org.miaixz.bus.mapper.binding.basic.ClassMapper
entityClass, entityTableMethods inherited from interface org.miaixz.bus.mapper.binding.condition.ConditionMapper
condition, countByCondition, deleteByCondition, selectByCondition, selectByCondition, selectOneByCondition, updateByCondition, updateByConditionSelective, updateByConditionSetValuesMethods inherited from interface org.miaixz.bus.mapper.binding.cursor.CursorMapper
selectCursor, selectCursorByConditionMethods inherited from interface org.miaixz.bus.mapper.binding.basic.EntityMapper
delete, deleteByPrimaryKey, insert, insertSelective, selectByPrimaryKey, selectCount, selectList, selectOne, updateByPrimaryKey, updateByPrimaryKeySelective
-
Method Details
-
wrapper
创建 Condition 查询封装对象- Returns:
- ConditionWrapper 对象
-
updateByPrimaryKeySelectiveWithForceFields
@Lang(Caching.class) @UpdateProvider(type=FunctionProvider.class, method="updateByPrimaryKeySelectiveWithForceFields") <S extends T> int updateByPrimaryKeySelectiveWithForceFields(@Param("entity") S entity, @Param("fns") Fn.FnArray<T> fields) 根据主键更新实体中非空字段,并强制更新指定字段- Type Parameters:
S- 实体类型- Parameters:
entity- 实体对象fields- 强制更新的字段集合,通过Fn.of(Fn...)创建Fn.FnArray- Returns:
- 1 表示成功,0 表示失败
-
updateForFieldListByPrimaryKey
@Lang(Caching.class) @UpdateProvider(type=FunctionProvider.class, method="updateForFieldListByPrimaryKey") <S extends T> int updateForFieldListByPrimaryKey(@Param("entity") S entity, @Param("fns") Fn.FnArray<T> fields) 根据主键更新指定字段集合- Type Parameters:
S- 实体类型- Parameters:
entity- 实体对象fields- 指定更新的字段集合,通过Fn.of(Fn...)创建Fn.FnArray- Returns:
- 1 表示成功,0 表示失败
-
selectByFieldList
根据指定字段集合查询,条件为 field IN (fieldValueList)- Type Parameters:
F- 字段类型- Parameters:
field- 字段方法引用fieldValueList- 字段值集合- Returns:
- 符合条件的实体对象列表
-
deleteByFieldList
根据指定字段集合删除,条件为 field IN (fieldValueList)- Type Parameters:
F- 字段类型- Parameters:
field- 字段方法引用fieldValueList- 字段值集合- Returns:
- 删除的记录数
-