Interface BaseDao<T,​I extends Serializable>

  • Type Parameters:
    T -
    I -
    All Superinterfaces:
    org.springframework.data.repository.CrudRepository<T,​I>, org.springframework.data.jpa.repository.JpaRepository<T,​I>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<T>, org.springframework.data.repository.PagingAndSortingRepository<T,​I>, org.springframework.data.repository.query.QueryByExampleExecutor<T>, org.springframework.data.repository.Repository<T,​I>
    All Known Implementing Classes:
    BaseDaoImpl

    @NoRepositoryBean
    public interface BaseDao<T,​I extends Serializable>
    extends org.springframework.data.jpa.repository.JpaRepository<T,​I>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<T>
    This is the base repository that every repository will extend we can write any common methods here.
    Since:
    15-May-2020, 11:12:29 AM
    Author:
    Baldeep Singh Kwatra
    • Method Summary

      Modifier and Type Method Description
      org.springframework.data.domain.Page<?> findAll​(org.springframework.data.jpa.domain.Specification<T> specs, org.springframework.data.domain.Pageable pageable, List<String> fields)  
      T getOne​(I id)  
      • Methods inherited from interface org.springframework.data.repository.CrudRepository

        count, delete, deleteAll, deleteAll, deleteById, existsById, findById, save
      • Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository

        deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, saveAll, saveAndFlush
      • Methods inherited from interface org.springframework.data.jpa.repository.JpaSpecificationExecutor

        count, findAll, findAll, findAll, findOne
      • Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository

        findAll
      • Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor

        count, exists, findAll, findOne
    • Method Detail

      • getOne

        @Query("select t from #{#entityName} t where t.id = ?1")
        T getOne​(I id)
        Specified by:
        getOne in interface org.springframework.data.jpa.repository.JpaRepository<T,​I extends Serializable>
      • findAll

        org.springframework.data.domain.Page<?> findAll​(org.springframework.data.jpa.domain.Specification<T> specs,
                                                        org.springframework.data.domain.Pageable pageable,
                                                        List<String> fields)