Package org.noear.wood.mapper
Class BaseMapperWrap<T>
java.lang.Object
org.noear.wood.mapper.BaseMapperWrap<T>
- All Implemented Interfaces:
BaseMapper<T>
Created by noear on 19-12-11.
-
Constructor Summary
ConstructorsConstructorDescriptionBaseMapperWrap(DbContext db, Class<?> entityType, String tableName) BaseMapperWrap(DbContext db, BaseMapper<T> baseMapper) -
Method Summary
Modifier and TypeMethodDescriptiondb()delete(Act1<MapperWhereQ> c) deleteById(Object id) deleteByIds(Iterable idList) deleteByMap(Map<String, Object> columnMap) Class<?>实体类protected Class<?>实体类型booleanexists(Act1<MapperWhereQ> c) booleanexistsById(Object id) protected DbTableQuerygetQr()获取查询器protected DbTableQuerygetQr(Act1<MapperWhereQ> c) 获取带条件的查询器插入数据,由外部组装数据voidinsertList(List<T> list) void批量插入数据selectArray(String column, int start, int size, Act1<MapperWhereQ> c) selectArray(String column, Act1<MapperWhereQ> c) selectById(Object id) selectByIds(Iterable idList) selectByMap(Map<String, Object> columnMap) selectItem(T entity) selectList(int start, int size, Act1<MapperWhereQ> c) selectMapList(int start, int size, Act1<MapperWhereQ> c) selectMapPage(int start, int size, Act1<MapperWhereQ> c) selectMapTop(int size, Act1<MapperWhereQ> c) selectPage(int start, int size, Act1<MapperWhereQ> c) selectReader(int fetchSize, Act1<MapperWhereQ> c) selectTop(int size, Act1<MapperWhereQ> c) selectValue(String column, Act1<MapperWhereQ> c) 表名tablePk()主键update(T entity, boolean excludeNull, Act1<MapperWhereQ> c) updateById(T entity, boolean excludeNull) updateById(T entity, Act2<T, DataItem> dataBuilder) int[]新增或修改数据 更新时根据主键更新新增或修改数据 更新时根据条件字段更新
-
Constructor Details
-
BaseMapperWrap
-
BaseMapperWrap
-
-
Method Details
-
entityType
实体类型 -
db
- Specified by:
dbin interfaceBaseMapper<T>
-
tableName
表名- Specified by:
tableNamein interfaceBaseMapper<T>
-
tablePk
主键- Specified by:
tablePkin interfaceBaseMapper<T>
-
entityClz
实体类- Specified by:
entityClzin interfaceBaseMapper<T>
-
insert
- Specified by:
insertin interfaceBaseMapper<T>
-
insert
插入数据,由外部组装数据- Specified by:
insertin interfaceBaseMapper<T>- Parameters:
entity- 写入的实体dataBuilder- 数据组装器- Returns:
-
insertList
- Specified by:
insertListin interfaceBaseMapper<T>
-
insertList
批量插入数据- Specified by:
insertListin interfaceBaseMapper<T>- Parameters:
list- 待插入的数据dataBuilder- 数据组装器
-
deleteById
- Specified by:
deleteByIdin interfaceBaseMapper<T>
-
deleteByIds
- Specified by:
deleteByIdsin interfaceBaseMapper<T>
-
deleteByMap
- Specified by:
deleteByMapin interfaceBaseMapper<T>
-
delete
- Specified by:
deletein interfaceBaseMapper<T>
-
updateById
- Specified by:
updateByIdin interfaceBaseMapper<T>
-
updateById
- Specified by:
updateByIdin interfaceBaseMapper<T>- Parameters:
entity- 待更新的实体dataBuilder- 组装data的方式,方便支持部分属性允许设置为null,部分不允许
-
update
- Specified by:
updatein interfaceBaseMapper<T>
-
update
- Specified by:
updatein interfaceBaseMapper<T>- Parameters:
entity- 待更新的实体dataBuilder- 组装data的方式,方便支持部分属性允许设置为null,部分不允许c- 更新数据的条件- Returns:
-
updateList
public int[] updateList(List<T> list, Act2<T, DataItem> dataBuilder, Property<T, ?>... conditionFields) - Specified by:
updateListin interfaceBaseMapper<T>
-
upsert
- Specified by:
upsertin interfaceBaseMapper<T>
-
upsert
新增或修改数据 更新时根据主键更新- Specified by:
upsertin interfaceBaseMapper<T>- Parameters:
entity- 要处理的实体dataBuilder- 数据组装器- Returns:
-
upsertBy
- Specified by:
upsertByin interfaceBaseMapper<T>
-
upsertBy
新增或修改数据 更新时根据条件字段更新- Specified by:
upsertByin interfaceBaseMapper<T>- Parameters:
entity- 要处理的实体dataBuilder- 数据组装器conditionFields- 更新的条件- Returns:
-
existsById
- Specified by:
existsByIdin interfaceBaseMapper<T>
-
exists
- Specified by:
existsin interfaceBaseMapper<T>
-
selectById
- Specified by:
selectByIdin interfaceBaseMapper<T>
-
selectByIds
- Specified by:
selectByIdsin interfaceBaseMapper<T>
-
selectByMap
- Specified by:
selectByMapin interfaceBaseMapper<T>
-
selectItem
- Specified by:
selectItemin interfaceBaseMapper<T>
-
selectItem
- Specified by:
selectItemin interfaceBaseMapper<T>
-
selectValue
- Specified by:
selectValuein interfaceBaseMapper<T>
-
selectMap
- Specified by:
selectMapin interfaceBaseMapper<T>
-
selectCount
- Specified by:
selectCountin interfaceBaseMapper<T>
-
selectList
- Specified by:
selectListin interfaceBaseMapper<T>
-
selectMapList
- Specified by:
selectMapListin interfaceBaseMapper<T>
-
selectArray
- Specified by:
selectArrayin interfaceBaseMapper<T>
-
selectList
- Specified by:
selectListin interfaceBaseMapper<T>
-
selectMapList
- Specified by:
selectMapListin interfaceBaseMapper<T>
-
selectArray
- Specified by:
selectArrayin interfaceBaseMapper<T>
-
selectReader
- Specified by:
selectReaderin interfaceBaseMapper<T>
-
selectReader
- Specified by:
selectReaderin interfaceBaseMapper<T>
-
selectPage
- Specified by:
selectPagein interfaceBaseMapper<T>
-
selectMapPage
- Specified by:
selectMapPagein interfaceBaseMapper<T>
-
selectTop
- Specified by:
selectTopin interfaceBaseMapper<T>
-
selectMapTop
- Specified by:
selectMapTopin interfaceBaseMapper<T>
-
getQr
获取查询器 -
getQr
获取带条件的查询器
-