Checking for NULL on a Collection in JPQL queries?
I am writing a JPQL query which queries based on a Categories collection. My categories can be null and hence I am checking using :categories=NULL. @Query("Select v from Vendor v join v.org vorg join v.categories cats WHERE vorg.email =:email AND (cats in :categories or :categories = NULL)") Set<Vendor> filterVendors(@Param("emailId") String emailId, @Param("categories") Set<Category> categories); The above works fine when categories is NULL. However, when categories is more than one value I get the error java.sql.SQLException: Operand should contain 1 column(s) And the hibernate relevant