Is it possible to bind a list in an EJB IN clause like this?
Query query = myEntitymanager.createNativeQuery("SELECT e FROM EntityName e WHERE e.id IN (:ids)");
//ids is a List of Long
query.setParameter("ids", ids);
result = query.getResultSet();
Is it possible to bind a list in an EJB IN clause like this?
Query query = myEntitymanager.createNativeQuery("SELECT e FROM EntityName e WHERE e.id IN (:ids)");
//ids is a List of Long
query.setParameter("ids", ids);
result = query.getResultSet();
IN clause works in JQPL, here http://docs.oracle.com/javaee/6/tutorial/doc/bnbuf.html#bnbvf you can read about it on javaee 6 specification.
But what do you wanna do?
In your example you are building a native query so IN clause support and behavior depends on wich jdbc driver you are using.