接口 HiverBaseService<T extends HiverBaseEntity,ID extends Long>
- 所有已知子接口:
DepartmentHeaderService,DepartmentService,LogService,PermissionService,RoleDepartmentService,RolePermissionService,RoleService,SettingService,StopWordService,UserRoleService,UserService
- 所有已知实现类:
DepartmentHeaderServiceImpl,DepartmentServiceImpl,HiverBaseServiceImpl,LogServiceImpl,PermissionServiceImpl,RoleDepartmentServiceImpl,RolePermissionServiceImpl,RoleServiceImpl,SettingServiceImpl,StopWordServiceImpl,UserRoleServiceImpl,UserServiceImpl
public interface HiverBaseService<T extends HiverBaseEntity,ID extends Long>
数据服务基类
尊重知识产权,CV 请保留版权,海文科技 https://hiver.cc 出品,不允许非法使用,后果自负
- 作者:
- Yazhi Li
-
方法概要
修饰符和类型方法说明long获取查询条件的结果数void根据Id删除void批量删除void删除voiddeleteAllById(List<ID> ids) 批量根据id删除org.springframework.data.domain.Page<T>findAll(org.springframework.data.domain.Pageable pageable) 分页获取根据条件查询获取org.springframework.data.domain.Page<T>findAll(org.springframework.data.jpa.domain.Specification<T> spec, org.springframework.data.domain.Pageable pageable) 根据查询条件分页获取根据ID获取 不存在则返回nullvoidflush()清空缓存,提交持久化根据ID获取 不存在且使用返回的对象时会抛异常getAll()获取所有列表获取总数保存saveOrUpdateAll(List<T> entities) 批量保存与修改修改
-
方法详细资料
-
get
根据ID获取 不存在且使用返回的对象时会抛异常- 参数:
id- 索引- 返回:
- 实体
-
findById
根据ID获取 不存在则返回null- 参数:
id- 索引- 返回:
- 实体
-
getAll
获取所有列表- 返回:
- 实体列表
-
getTotalCount
Long getTotalCount()获取总数- 返回:
- 实体总数
-
save
保存- 参数:
entity- 实体- 返回:
- 实体
-
update
修改- 参数:
entity- 实体- 返回:
- 实体
-
saveOrUpdateAll
批量保存与修改- 参数:
entities- 实体列表- 返回:
- 实体列表
-
delete
删除- 参数:
entity- 实体
-
delete
根据Id删除- 参数:
id- 索引
-
deleteAllById
批量根据id删除- 参数:
ids- 索引列表
-
delete
批量删除- 参数:
entities- 实体列表
-
flush
void flush()清空缓存,提交持久化 -
findAll
根据条件查询获取- 参数:
spec- 查询条件- 返回:
- 实体列表
-
findAll
分页获取- 参数:
pageable- 分页条件- 返回:
- 实体列表
-
findAll
org.springframework.data.domain.Page<T> findAll(org.springframework.data.jpa.domain.Specification<T> spec, org.springframework.data.domain.Pageable pageable) 根据查询条件分页获取- 参数:
spec- 查询条件pageable- 分页条件- 返回:
- 实体列表
-
count
获取查询条件的结果数- 参数:
spec- 查询条件- 返回:
- 结果数
-