My code calls SQLGrammarExceptionwhen I set an empty set to the SQL IN parameter:
Query query = this.entMngr.createNativeQuery("SELECT foo_id, first, last FROM foo WHERE bar IN :barSet");
query.setParameter("barSet", barSet);
List<Object> nativeList = query.getResultList();
Everything works when the set is not empty. How can I do this agnostic about whether the collection is full (or any collection presented)?
source
share