Interface IResourceTableDao

    • Method Detail

      • findIdsOfDeletedResources

        @Query("SELECT t.myId FROM ResourceTable t WHERE t.myDeleted IS NOT NULL")
        org.springframework.data.domain.Slice<LongfindIdsOfDeletedResources​(org.springframework.data.domain.Pageable thePageable)
      • findIdsOfDeletedResourcesOfType

        @Query("SELECT t.myId FROM ResourceTable t WHERE t.myResourceType = :restype AND t.myDeleted IS NOT NULL")
        org.springframework.data.domain.Slice<LongfindIdsOfDeletedResourcesOfType​(org.springframework.data.domain.Pageable thePageable,
                                                                                    @Param("restype")
                                                                                    String theResourceName)
      • findIdsOfDeletedResourcesOfType

        @Query("SELECT t.myId FROM ResourceTable t WHERE t.myId = :resid AND t.myResourceType = :restype AND t.myDeleted IS NOT NULL")
        org.springframework.data.domain.Slice<LongfindIdsOfDeletedResourcesOfType​(org.springframework.data.domain.Pageable thePageable,
                                                                                    @Param("resid")
                                                                                    Long theResourceId,
                                                                                    @Param("restype")
                                                                                    String theResourceName)
      • getResourceCounts

        @Query("SELECT t.myResourceType as type, COUNT(t.myResourceType) as count FROM ResourceTable t GROUP BY t.myResourceType")
        List<Map<?,​?>> getResourceCounts()
      • findIdsOfResourcesWithinUpdatedRangeOrderedFromNewest

        @Query("SELECT t.myId FROM ResourceTable t WHERE t.myUpdated >= :low AND t.myUpdated <= :high ORDER BY t.myUpdated DESC")
        org.springframework.data.domain.Slice<LongfindIdsOfResourcesWithinUpdatedRangeOrderedFromNewest​(org.springframework.data.domain.Pageable thePage,
                                                                                                          @Param("low")
                                                                                                          Date theLow,
                                                                                                          @Param("high")
                                                                                                          Date theHigh)
      • findIdsOfResourcesWithinUpdatedRangeOrderedFromOldest

        @Query("SELECT t.myId FROM ResourceTable t WHERE t.myUpdated >= :low AND t.myUpdated <= :high ORDER BY t.myUpdated ASC")
        org.springframework.data.domain.Slice<LongfindIdsOfResourcesWithinUpdatedRangeOrderedFromOldest​(org.springframework.data.domain.Pageable thePage,
                                                                                                          @Param("low")
                                                                                                          Date theLow,
                                                                                                          @Param("high")
                                                                                                          Date theHigh)
      • findIdsOfPartitionedResourcesWithinUpdatedRangeOrderedFromOldest

        @Query("SELECT t.myId FROM ResourceTable t WHERE t.myUpdated >= :low AND t.myUpdated <= :high AND t.myPartitionIdValue = :partition_id ORDER BY t.myUpdated ASC")
        org.springframework.data.domain.Slice<LongfindIdsOfPartitionedResourcesWithinUpdatedRangeOrderedFromOldest​(org.springframework.data.domain.Pageable thePage,
                                                                                                                     @Param("low")
                                                                                                                     Date theLow,
                                                                                                                     @Param("high")
                                                                                                                     Date theHigh,
                                                                                                                     @Param("partition_id")
                                                                                                                     Integer theRequestPartitionId)
      • findIdsOfResourcesWithinUpdatedRangeOrderedFromOldest

        @Query("SELECT t.myId FROM ResourceTable t WHERE t.myUpdated >= :low AND t.myUpdated <= :high AND t.myResourceType = :restype ORDER BY t.myUpdated ASC")
        org.springframework.data.domain.Slice<LongfindIdsOfResourcesWithinUpdatedRangeOrderedFromOldest​(org.springframework.data.domain.Pageable thePage,
                                                                                                          @Param("restype")
                                                                                                          String theResourceType,
                                                                                                          @Param("low")
                                                                                                          Date theLow,
                                                                                                          @Param("high")
                                                                                                          Date theHigh)
      • updateIndexStatus

        @Modifying
        @Query("UPDATE ResourceTable t SET t.myIndexStatus = :status WHERE t.myId = :id")
        void updateIndexStatus​(@Param("id")
                               Long theId,
                               @Param("status")
                               Long theIndexStatus)
      • deleteByPid

        @Modifying
        @Query("DELETE FROM ResourceTable t WHERE t.myId = :pid")
        void deleteByPid​(@Param("pid")
                         Long theId)
      • findLookupFieldsByResourcePid

        @Query("SELECT t.myResourceType, t.myId, t.myDeleted FROM ResourceTable t WHERE t.myId IN (:pid)")
        Collection<Object[]> findLookupFieldsByResourcePid​(@Param("pid")
                                                           List<Long> thePids)
        This method returns a Collection where each row is an element in the collection. Each element in the collection is an object array, where the order matters (the array represents columns returned by the query). Be careful if you change this query in any way.
      • findLookupFieldsByResourcePidInPartitionIds

        @Query("SELECT t.myResourceType, t.myId, t.myDeleted FROM ResourceTable t WHERE t.myId IN (:pid) AND t.myPartitionIdValue IN :partition_id")
        Collection<Object[]> findLookupFieldsByResourcePidInPartitionIds​(@Param("pid")
                                                                         List<Long> thePids,
                                                                         @Param("partition_id")
                                                                         Collection<Integer> thePartitionId)
        This method returns a Collection where each row is an element in the collection. Each element in the collection is an object array, where the order matters (the array represents columns returned by the query). Be careful if you change this query in any way.
      • findLookupFieldsByResourcePidInPartitionIdsOrNullPartition

        @Query("SELECT t.myResourceType, t.myId, t.myDeleted FROM ResourceTable t WHERE t.myId IN (:pid) AND (t.myPartitionIdValue IS NULL OR t.myPartitionIdValue IN :partition_id)")
        Collection<Object[]> findLookupFieldsByResourcePidInPartitionIdsOrNullPartition​(@Param("pid")
                                                                                        List<Long> thePids,
                                                                                        @Param("partition_id")
                                                                                        Collection<Integer> thePartitionId)
        This method returns a Collection where each row is an element in the collection. Each element in the collection is an object array, where the order matters (the array represents columns returned by the query). Be careful if you change this query in any way.
      • findLookupFieldsByResourcePidInPartitionNull

        @Query("SELECT t.myResourceType, t.myId, t.myDeleted FROM ResourceTable t WHERE t.myId IN (:pid) AND t.myPartitionIdValue IS NULL")
        Collection<Object[]> findLookupFieldsByResourcePidInPartitionNull​(@Param("pid")
                                                                          List<Long> thePids)
        This method returns a Collection where each row is an element in the collection. Each element in the collection is an object array, where the order matters (the array represents columns returned by the query). Be careful if you change this query in any way.
      • findCurrentVersionByPid

        @Query("SELECT t.myVersion FROM ResourceTable t WHERE t.myId = :pid")
        Long findCurrentVersionByPid​(@Param("pid")
                                     Long thePid)
      • getResourceVersionsForPid

        @Query("SELECT t.myId, t.myResourceType, t.myVersion FROM ResourceTable t WHERE t.myId IN ( :pid )")
        Collection<Object[]> getResourceVersionsForPid​(@Param("pid")
                                                       List<Long> pid)
        This query will return rows with the following values: Id (resource pid - long), ResourceType (Patient, etc), version (long) Order matters!
        Parameters:
        pid - - list of pids to get versions for
        Returns:
      • readByPartitionIdNull

        @Query("SELECT t FROM ResourceTable t LEFT JOIN FETCH t.myForcedId WHERE t.myPartitionId.myPartitionId IS NULL AND t.myId = :pid")
        Optional<ResourceTablereadByPartitionIdNull​(@Param("pid")
                                                      Long theResourceId)
      • readByPartitionId

        @Query("SELECT t FROM ResourceTable t LEFT JOIN FETCH t.myForcedId WHERE t.myPartitionId.myPartitionId = :partitionId AND t.myId = :pid")
        Optional<ResourceTablereadByPartitionId​(@Param("partitionId")
                                                  int thePartitionId,
                                                  @Param("pid")
                                                  Long theResourceId)
      • readByPartitionIdsOrNull

        @Query("SELECT t FROM ResourceTable t LEFT JOIN FETCH t.myForcedId WHERE (t.myPartitionId.myPartitionId IS NULL OR t.myPartitionId.myPartitionId IN (:partitionIds)) AND t.myId = :pid")
        Optional<ResourceTablereadByPartitionIdsOrNull​(@Param("partitionIds")
                                                         Collection<Integer> thrValues,
                                                         @Param("pid")
                                                         Long theResourceId)