Interface ISearchDao

  • All Superinterfaces:
    org.springframework.data.repository.CrudRepository<Search,​Long>, org.springframework.data.jpa.repository.JpaRepository<Search,​Long>, org.springframework.data.repository.PagingAndSortingRepository<Search,​Long>, org.springframework.data.repository.query.QueryByExampleExecutor<Search>, org.springframework.data.repository.Repository<Search,​Long>

    public interface ISearchDao
    extends org.springframework.data.jpa.repository.JpaRepository<Search,​Long>
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int countDeleted()  
      void deleteByPid​(Long theId)  
      Optional<Search> findByUuidAndFetchIncludes​(String theUuid)  
      org.springframework.data.domain.Slice<Long> findDeleted​(org.springframework.data.domain.Pageable thePage)  
      org.springframework.data.domain.Slice<Long> findWhereCreatedBefore​(Date theCutoff, Date theNow, org.springframework.data.domain.Pageable thePage)  
      Collection<Search> findWithCutoffOrExpiry​(String theResourceType, int theHashCode, Date theCreatedCutoff)  
      void updateDeleted​(Long thePid, boolean theDeleted)  
      • Methods inherited from interface org.springframework.data.repository.CrudRepository

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

        deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getById, getOne, saveAll, saveAllAndFlush, saveAndFlush
      • 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

      • findWhereCreatedBefore

        @Query("SELECT s.myId FROM Search s WHERE (s.myCreated < :cutoff) AND (s.myExpiryOrNull IS NULL OR s.myExpiryOrNull < :now) AND (s.myDeleted IS NULL OR s.myDeleted = FALSE)")
        org.springframework.data.domain.Slice<LongfindWhereCreatedBefore​(@Param("cutoff")
                                                                           Date theCutoff,
                                                                           @Param("now")
                                                                           Date theNow,
                                                                           org.springframework.data.domain.Pageable thePage)
      • findDeleted

        @Query("SELECT s.myId FROM Search s WHERE s.myDeleted = TRUE")
        org.springframework.data.domain.Slice<LongfindDeleted​(org.springframework.data.domain.Pageable thePage)
      • findWithCutoffOrExpiry

        @Query("SELECT s FROM Search s WHERE s.myResourceType = :type AND mySearchQueryStringHash = :hash AND (s.myCreated > :cutoff) AND s.myDeleted = false AND s.myStatus <> \'FAILED\'")
        Collection<SearchfindWithCutoffOrExpiry​(@Param("type")
                                                  String theResourceType,
                                                  @Param("hash")
                                                  int theHashCode,
                                                  @Param("cutoff")
                                                  Date theCreatedCutoff)
      • countDeleted

        @Query("SELECT COUNT(s) FROM Search s WHERE s.myDeleted = TRUE")
        int countDeleted()
      • updateDeleted

        @Modifying
        @Query("UPDATE Search s SET s.myDeleted = :deleted WHERE s.myId = :pid")
        void updateDeleted​(@Param("pid")
                           Long thePid,
                           @Param("deleted")
                           boolean theDeleted)
      • deleteByPid

        @Modifying
        @Query("DELETE FROM Search s WHERE s.myId = :pid")
        void deleteByPid​(@Param("pid")
                         Long theId)