接口 BaseRepository<T extends BaseEntity,​ID>

  • 所有超级接口:
    org.springframework.data.repository.CrudRepository<T,​ID>, org.springframework.data.jpa.repository.JpaRepository<T,​ID>, org.springframework.data.repository.PagingAndSortingRepository<T,​ID>, org.springframework.data.repository.query.QueryByExampleExecutor<T>, org.springframework.data.repository.Repository<T,​ID>

    @NoRepositoryBean
    public interface BaseRepository<T extends BaseEntity,​ID>
    extends org.springframework.data.jpa.repository.JpaRepository<T,​ID>
    作者:
    youta
    • 方法概要

      所有方法 实例方法 抽象方法 
      修饰符和类型 方法 说明
      List<T> findAll​(org.springframework.data.jpa.domain.Specification<T> spec)
      Description:使用条件查询,不分页
      org.springframework.data.domain.Page<T> findAll​(org.springframework.data.jpa.domain.Specification<T> spec, org.springframework.data.domain.Pageable pageable)
      Description:这是一个多条件动态查询的例子,类似Mybatis中动态sql的功能
      List<T> findTop25ByOrderByIdDesc()
      Description:获取前25条数据
      • 从接口继承的方法 org.springframework.data.repository.CrudRepository

        count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save
      • 从接口继承的方法 org.springframework.data.jpa.repository.JpaRepository

        deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getById, getOne, saveAll, saveAllAndFlush, saveAndFlush
      • 从接口继承的方法 org.springframework.data.repository.PagingAndSortingRepository

        findAll
      • 从接口继承的方法 org.springframework.data.repository.query.QueryByExampleExecutor

        count, exists, findAll, findOne
    • 方法详细资料

      • findAll

        org.springframework.data.domain.Page<T> findAll​(org.springframework.data.jpa.domain.Specification<T> spec,
                                                        org.springframework.data.domain.Pageable pageable)
        Description:这是一个多条件动态查询的例子,类似Mybatis中动态sql的功能
        参数:
        spec - 高级条件
        pageable - 分页对象
        返回:
        分页对象
      • findAll

        List<T> findAll​(org.springframework.data.jpa.domain.Specification<T> spec)
        Description:使用条件查询,不分页
        参数:
        spec - 高级条件
        返回:
        列表集合
      • findTop25ByOrderByIdDesc

        List<T> findTop25ByOrderByIdDesc()
        Description:获取前25条数据
        返回:
        列表集合