i want to pass a list in which all should match.
@Query("select g.name as name FROM Gym g " +
"LEFT JOIN g.listOfEquipment listOfEquipment " +
"WHERE " +
"(((:listOfEquipment) is null) or listOfEquipment.id in (:listOfEquipment)) "+
"AND (((:listOfAmenity) is null) or listOfAmenity.id in (:listOfAmenity))")
Page<Map<String, Object>> listing(@Param("listOfEquipment") Set<Integer> listOfEquipment,@Param("listOfAmenity") Set<Integer> listOfAmenity)
above query working for OR but i need AND
suppose i am passing 1,2,3
then result should be all gym who has equipment 1 and 2 and 3
same for amenity also
i tried Finding items with a set containing all elements of a given set with jpql
but its not helping me becuase there are multiple filters
url is
http://localhost:8080/filter?listOfEquipment=5,3&listOfAmenity=51,13&sort=name