Interface ISearchDao

All Superinterfaces:
org.springframework.data.repository.CrudRepository<Search,Long>, IHapiFhirJpaRepository, org.springframework.data.jpa.repository.JpaRepository<Search,Long>, org.springframework.data.repository.ListCrudRepository<Search,Long>, org.springframework.data.repository.ListPagingAndSortingRepository<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>, IHapiFhirJpaRepository
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    void
     
    void
    deleteByPids(Collection<Long> theSearchToDelete)
     
     
     
    findWhereCreatedBefore(Date theCutoff, Date theNow)
     
    findWithCutoffOrExpiry(String theResourceType, int theHashCode, Date theCreatedCutoff)
     
    int
    updateDeleted(Set<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, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlush

    Methods inherited from interface org.springframework.data.repository.ListCrudRepository

    findAll, findAllById, saveAll

    Methods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository

    findAll

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

    count, exists, findAll, findBy, findOne
  • Method Details

    • findByUuidAndFetchIncludes

      @Query("SELECT s FROM Search s LEFT OUTER JOIN FETCH s.myIncludes WHERE s.myUuid = :uuid") Optional<Search> findByUuidAndFetchIncludes(@Param("uuid") String theUuid)
    • 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)") Stream<Long> findWhereCreatedBefore(@Param("cutoff") Date theCutoff, @Param("now") Date theNow)
    • findDeleted

      @Query("SELECT new ca.uhn.fhir.jpa.dao.data.SearchIdAndResultSize(s.myId, (select max(sr.myOrder) as maxOrder from SearchResult sr where sr.mySearchPid = s.myId)) FROM Search s WHERE s.myDeleted = TRUE") Stream<SearchIdAndResultSize> findDeleted()
    • findWithCutoffOrExpiry

      @Query("SELECT s FROM Search s WHERE s.myResourceType = :type AND s.mySearchQueryStringHash = :hash AND (s.myCreated > :cutoff) AND s.myDeleted = FALSE AND s.myStatus <> \'FAILED\'") Collection<Search> findWithCutoffOrExpiry(@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 in (:pids)") @CanIgnoreReturnValue int updateDeleted(@Param("pids") Set<Long> thePid, @Param("deleted") boolean theDeleted)
    • deleteByPid

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

      @Modifying @Query("DELETE FROM Search s WHERE s.myId in (:pids)") void deleteByPids(@Param("pids") Collection<Long> theSearchToDelete)