接口 HiverBaseService<E,ID extends Serializable>

所有已知子接口:
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<E,ID extends Serializable>
数据服务基类

尊重知识产权,CV 请保留版权,海文科技 https://hiver.cc 出品,不允许非法使用,后果自负

作者:
Yazhi Li
  • 方法概要

    修饰符和类型
    方法
    说明
    long
    count(org.springframework.data.jpa.domain.Specification<E> spec)
    获取查询条件的结果数
    void
    delete(E entity)
    删除
    void
    delete(ID id)
    根据Id删除
    void
    delete(Iterable<E> entities)
    批量删除
    void
    批量根据id删除
    org.springframework.data.domain.Page<E>
    findAll(org.springframework.data.domain.Pageable pageable)
    分页获取
    findAll(org.springframework.data.jpa.domain.Specification<E> spec)
    根据条件查询获取
    org.springframework.data.domain.Page<E>
    findAll(org.springframework.data.jpa.domain.Specification<E> spec, org.springframework.data.domain.Pageable pageable)
    根据查询条件分页获取
    根据ID获取 不存在则返回null
    void
    清空缓存,提交持久化
    get(ID id)
    根据ID获取 不存在且使用返回的对象时会抛异常
    获取所有列表
    获取总数
    save(E entity)
    保存
    批量保存与修改
    update(E entity)
    修改
  • 方法详细资料

    • get

      E get(ID id)
      根据ID获取 不存在且使用返回的对象时会抛异常
      参数:
      id - 索引
      返回:
      实体
    • findById

      E findById(ID id)
      根据ID获取 不存在则返回null
      参数:
      id - 索引
      返回:
      实体
    • getAll

      List<E> getAll()
      获取所有列表
      返回:
      实体列表
    • getTotalCount

      Long getTotalCount()
      获取总数
      返回:
      实体总数
    • save

      E save(E entity)
      保存
      参数:
      entity - 实体
      返回:
      实体
    • update

      E update(E entity)
      修改
      参数:
      entity - 实体
      返回:
      实体
    • saveOrUpdateAll

      Iterable<E> saveOrUpdateAll(Iterable<E> entities)
      批量保存与修改
      参数:
      entities - 实体列表
      返回:
      实体列表
    • delete

      void delete(E entity)
      删除
      参数:
      entity - 实体
    • delete

      void delete(ID id)
      根据Id删除
      参数:
      id - 索引
    • deleteAllById

      void deleteAllById(Iterable<ID> ids)
      批量根据id删除
      参数:
      ids - 索引列表
    • delete

      void delete(Iterable<E> entities)
      批量删除
      参数:
      entities - 实体列表
    • flush

      void flush()
      清空缓存,提交持久化
    • findAll

      List<E> findAll(org.springframework.data.jpa.domain.Specification<E> spec)
      根据条件查询获取
      参数:
      spec - 查询条件
      返回:
      实体列表
    • findAll

      org.springframework.data.domain.Page<E> findAll(org.springframework.data.domain.Pageable pageable)
      分页获取
      参数:
      pageable - 分页条件
      返回:
      实体列表
    • findAll

      org.springframework.data.domain.Page<E> findAll(org.springframework.data.jpa.domain.Specification<E> spec, org.springframework.data.domain.Pageable pageable)
      根据查询条件分页获取
      参数:
      spec - 查询条件
      pageable - 分页条件
      返回:
      实体列表
    • count

      long count(org.springframework.data.jpa.domain.Specification<E> spec)
      获取查询条件的结果数
      参数:
      spec - 查询条件
      返回:
      结果数