I am trying to exclude a bunch of results from the SELECT database using the keywords "NOT IN", but the list of exceptions is still being returned. Using JPQL (JPA2.0), my query looks like this:
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);
exception List is a StringBuffer. It is reported that I do not see an error, but the identifier in the list of exceptions is still returned. Is there an alternative to JPQL for this?
Thanks in advance.
source share