title: Adding IN clause List to a JPA Query
body: <p>I have built a NamedQuery that looks like this:</p>
  
  <pre><code>@NamedQuery(name = "EventLog.viewDatesInclude",
          query = "SELECT el FROM EventLog el WHERE el.timeMark &gt;= :dateFrom AND "
          + "el.timeMark &lt;= :dateTo AND "
          + "el.name IN (:inclList)")
  </code></pre>
  
  <p>What I want to do is fill in the parameter :inclList with a list of items instead of one item.  For example if I have a <code>new List&lt;String&gt;() { "a", "b", "c" }</code> how do I get that in the :inclList parameter?  It only lets me codify one string.   For example:</p>
  
  <pre><code>setParameter("inclList", "a") // works
  
  setParameter("inclList", "a, b") // does not work
  
  setParameter("inclList", "'a', 'b'") // does not work
  
  setParameter("inclList", list) // throws an exception
  </code></pre>
  
  <p>I know I could just build a string and build the whole Query from that, but I wanted to avoid the overhead.   Is there a better way of doing this?</p>
  
  <p>Related question: if the List is very large, is there any good way of building query like that? </p>