title: JPQL query not using "NOT IN" command
body: <p>I'm trying to exclude a bunch of results from a database SELECT using the "NOT IN" keywords, but the exclusion list is still being returned.  Using JPQL (JPA2.0) my query looks like:</p>
  
  <pre><code>Query query = em.createQuery("SELECT foo.id FROM FooEntity fooEntity WHERE foo.id NOT IN ('" + exclusionList.toString() + "') ORDER BY foo.id").setFirstResult(startPosition).setMaxResults(numberOfAppsToReturn);
  </code></pre>
  
  <p>exclusionList is a StringBuffer.  There is no error reported that I can see, but the id's in the exclusion list are still returned.  Is there an alternative JPQL way of doing this?</p>
  
  <p>Thanks in advance.</p>