Ich versuche folgende Abfrage aus SpringBoot RepositoryWie IN-Operator verwenden, in denen Klausel SpringBoot Cassandra
@Query("select * from c where id1 =?0 and id2 =?1 and id3 =?2 and c1 =?3 and year in :year and month in :month and day in :day and hour in :hour and minute in :minute"
public List<Counter> findCWithinRangeIn(
@Param("id1") String id1,
@Param("id2") String id2,
@Param("id3") String id3,
@Param("c1") String c1,
@Param("year") List<Integer> year,
@Param("month") List<Integer> month,
@Param("day") List<Integer> day,
@Param("hour") List<Integer> hour,
@Param("minute") List<Integer> minute);
aber immer schlagen Fehler auszuführen: Ungültige Menge von Bind-Variablen.
Bitte schlagen Sie vor, wie Sie weiter vorgehen.
Hinweis: Ich habe Spring CrudRepository findByInventoryIds(List<Long> inventoryIdList) - equivalent to IN clause folgen, aber es hat nicht für mich funktioniert.
Ich möchte wie etwas auszuführen:
select * from c
where id1 ="xyz" and
id2 ="abc" and
id3 ="pqr" and
c1 = "Sample" and
year IN (2016,2017) and
month IN (9,10,11) and
day IN (19,20,24) and
hour IN (23, 13) and
minute IN (50, 51, 53)
Von der Spitze meines Kopfes stört mich, dass Sie Bindemethoden mischen. Sie verwenden? 0,? 1 usw., aber Sie benennen Ihre Parameter (id1, id2). Was passiert, wenn Sie das? 0 zu: id1 und das? 1 zu: id2 usw. ändern? – datasedai
Das funktioniert auch nicht – Kanhaiya