From 0956ca99f042fca29644c01cdf75356b17beaa60 Mon Sep 17 00:00:00 2001 From: slaurenz <82034561+slaurenz@users.noreply.github.com> Date: Fri, 8 Apr 2022 16:41:18 +0200 Subject: [PATCH] Fix lookup --- .../revocationdistribution/repository/HashesRepository.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/HashesRepository.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/HashesRepository.java index 3f1ade1..2d817cf 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/HashesRepository.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/HashesRepository.java @@ -38,10 +38,10 @@ public interface HashesRepository extends JpaRepository { @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 getHashesPresentInListAndDb(@Param("hashes") List 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 getHashesPresentInListAndDbAndNotExpired( @Param("hashes") List hashes, @Param("checkTime") ZonedDateTime checkTime);