JPA passing list to IN clause in named native query

The above accepted answer is not correct and led me off track for many days !! JPA and Hibernate both accept collections in native query using Query. You just need to do String nativeQuery = “Select * from A where name in :names”; //use (:names) for older versions of hibernate Query q = em.createNativeQuery(nativeQuery); q.setParameter(“names”, … Read more