类 SuperServiceImpl<M extends SuperManager<Entity>,Id extends Serializable,Entity extends SuperEntity<?>>
java.lang.Object
top.tangyh.basic.base.service.impl.SuperServiceImpl<M,Id,Entity>
- 类型参数:
M- ManagerId- IDEntity- 实体
- 所有已实现的接口:
SuperService<Id,Entity>
- 直接已知子类:
SuperCacheServiceImpl
public class SuperServiceImpl<M extends SuperManager<Entity>,Id extends Serializable,Entity extends SuperEntity<?>>
extends Object
implements SuperService<Id,Entity>
不含缓存的Service实现
2,removeById:重写 ServiceImpl 类的方法,删除db 3,removeByIds:重写 ServiceImpl 类的方法,删除db 4,updateAllById: 新增的方法: 修改数据(所有字段) 5,updateById:重写 ServiceImpl 类的方法,修改db后
- 作者:
- zuihou
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明复制一条数据根据 ID 查询获取实体的类型获取主键的类型获取Manager的类型查询列表批量查询<E extends com.baomidou.mybatisplus.core.metadata.IPage<Entity>>
E翻页查询booleanremoveByIds(Collection<Id> idList) 删除(根据ID 批量删除)<SaveVO> Entitysave(SaveVO saveVO) 插入一条记录(选择字段,策略插入)protected <SaveVO> void保存之后设置参数值,淘汰缓存等操作boolean批量保存protected <SaveVO> EntitysaveBefore(SaveVO saveVO) 保存之前处理参数等操作protected <UpdateVO> voidupdateAfter(UpdateVO updateVO, Entity entity) 修改之后设置参数值,淘汰缓存等操作protected <UpdateVO> voidupdateAllAfter(UpdateVO updateVO, Entity entity) 修改之后设置参数值,淘汰缓存等操作protected <UpdateVO> EntityupdateAllBefore(UpdateVO updateVO) 修改之前处理参数等操作<UpdateVO> EntityupdateAllById(UpdateVO updateVO) 根据id修改 entity 的所有字段protected <UpdateVO> EntityupdateBefore(UpdateVO updateVO) 修改之前处理参数等操作<UpdateVO> EntityupdateById(UpdateVO updateVO) 根据 ID 修改实体中非空的字段
-
字段详细资料
-
superManager
-
managerClass
-
entityClass
-
idClass
-
-
构造器详细资料
-
SuperServiceImpl
public SuperServiceImpl()
-
-
方法详细资料
-
getSuperManager
从接口复制的说明:SuperService获取Manager的类型- 指定者:
getSuperManager在接口中SuperService<M extends SuperManager<Entity>,Id extends Serializable> - 返回:
- Manager的class类型
-
getEntityClass
从接口复制的说明:SuperService获取实体的类型- 指定者:
getEntityClass在接口中SuperService<M extends SuperManager<Entity>,Id extends Serializable> - 返回:
- 实体类class类型
-
getIdClass
从接口复制的说明:SuperService获取主键的类型- 指定者:
getIdClass在接口中SuperService<M extends SuperManager<Entity>,Id extends Serializable> - 返回:
- 主键class类型
-
currentManagerClass
-
currentIdClass
-
currentModelClass
-
save
从接口复制的说明:SuperService插入一条记录(选择字段,策略插入)- 指定者:
save在接口中SuperService<M extends SuperManager<Entity>,Id extends Serializable> - 参数:
saveVO- 实体对象- 返回:
- 是否插入成功
-
saveBatch
@Transactional(rollbackFor=java.lang.Exception.class) public boolean saveBatch(List<Entity> entityList) 从接口复制的说明:SuperService批量保存- 指定者:
saveBatch在接口中SuperService<M extends SuperManager<Entity>,Id extends Serializable> - 参数:
entityList- 实体集合- 返回:
- 是否执行成功
-
saveBefore
保存之前处理参数等操作- 参数:
saveVO- 保存VO
-
saveAfter
保存之后设置参数值,淘汰缓存等操作- 参数:
saveVO- 保存VOentity- 实体
-
updateById
@Transactional(rollbackFor=java.lang.Exception.class) public <UpdateVO> Entity updateById(UpdateVO updateVO) 从接口复制的说明:SuperService根据 ID 修改实体中非空的字段- 指定者:
updateById在接口中SuperService<M extends SuperManager<Entity>,Id extends Serializable> - 参数:
updateVO- 实体对象- 返回:
- 是否修改成功
-
updateBefore
修改之前处理参数等操作- 参数:
updateVO- 修改VO
-
updateAfter
修改之后设置参数值,淘汰缓存等操作- 参数:
updateVO- 修改VOentity- 实体
-
updateAllById
@Transactional(rollbackFor=java.lang.Exception.class) public <UpdateVO> Entity updateAllById(UpdateVO updateVO) 从接口复制的说明:SuperService根据id修改 entity 的所有字段- 指定者:
updateAllById在接口中SuperService<M extends SuperManager<Entity>,Id extends Serializable> - 参数:
updateVO- 实体对象- 返回:
- 是否修改成功
-
updateAllBefore
修改之前处理参数等操作- 参数:
updateVO- 修改VO
-
updateAllAfter
修改之后设置参数值,淘汰缓存等操作- 参数:
updateVO- 修改VOentity- 实体
-
copy
从接口复制的说明:SuperService复制一条数据注意:若该数据存在唯一索引等限制条件,需要重写该方法进行判断或处理。
- 指定者:
copy在接口中SuperService<M extends SuperManager<Entity>,Id extends Serializable> - 参数:
id- ID- 返回:
- 复制后的实体
-
removeByIds
@Transactional(rollbackFor=java.lang.Exception.class) public boolean removeByIds(Collection<Id> idList) 从接口复制的说明:SuperService删除(根据ID 批量删除)- 指定者:
removeByIds在接口中SuperService<M extends SuperManager<Entity>,Id extends Serializable> - 参数:
idList- 主键ID列表- 返回:
- 是否删除成功
-
getById
从接口复制的说明:SuperService根据 ID 查询- 指定者:
getById在接口中SuperService<M extends SuperManager<Entity>,Id extends Serializable> - 参数:
id- 主键ID- 返回:
- 实体对象或null
-
list
@Transactional(readOnly=true) public List<Entity> list(com.baomidou.mybatisplus.core.conditions.Wrapper<Entity> queryWrapper) 从接口复制的说明:SuperService查询列表- 指定者:
list在接口中SuperService<M extends SuperManager<Entity>,Id extends Serializable> - 参数:
queryWrapper- 实体对象封装操作类QueryWrapper- 返回:
- 实体对象集合或空集合
-
listByIds
从接口复制的说明:SuperService批量查询- 指定者:
listByIds在接口中SuperService<M extends SuperManager<Entity>,Id extends Serializable> - 参数:
ids- 主键- 返回:
- 实体对象集合或空集合
-
page
@Transactional(readOnly=true) public <E extends com.baomidou.mybatisplus.core.metadata.IPage<Entity>> E page(E page, com.baomidou.mybatisplus.core.conditions.Wrapper<Entity> queryWrapper) 从接口复制的说明:SuperService翻页查询- 指定者:
page在接口中SuperService<M extends SuperManager<Entity>,Id extends Serializable> - 参数:
page- 翻页对象queryWrapper- 实体对象封装操作类QueryWrapper- 返回:
- 实体分页对象
-