0

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();
Martin G
  • 17,357
  • 9
  • 82
  • 98
  • Why don't you try it & post the question in case of problem. Similar one, can refer http://stackoverflow.com/a/4644668/366964 – Nayan Wadekar Nov 05 '12 at 09:43

1 Answers1

0

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.

Guillermo
  • 1,523
  • 9
  • 19