Skip to content

Commit

Permalink
Fix lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
slaurenz committed Apr 8, 2022
1 parent 35af983 commit 0956ca9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ public interface HashesRepository extends JpaRepository<HashesEntity, String> {
@Query("DELETE HashesEntity h WHERE h.batch = null")
void deleteAllOrphanedHashes();

@Query("SELECT h.id FROM HashesEntity h WHERE h.id IN :hashes")
@Query("SELECT h.hash FROM HashesEntity h WHERE h.hash IN :hashes")
List<String> getHashesPresentInListAndDb(@Param("hashes") List<String> hashes);

@Query("SELECT h.id FROM HashesEntity h INNER JOIN h.batch b WHERE h.id IN :hashes AND b.expires > :checkTime")
@Query("SELECT h.hash FROM HashesEntity h INNER JOIN h.batch b WHERE h.hash IN :hashes AND b.expires > :checkTime")
List<String> getHashesPresentInListAndDbAndNotExpired(
@Param("hashes") List<String> hashes,
@Param("checkTime") ZonedDateTime checkTime);
Expand Down

0 comments on commit 0956ca9

Please sign in to comment.