title: How to do JPA query with Criteria Clause?
body: <p>First I want to do a query like </p>
  
  <pre><code>"select count(*) from Post p where p.tag in (tagArray) "
  </code></pre>
  
  <p>where tagArray is "'tag1','tag2','tag3'".then I'd like to do a paginate query: </p>
  
  <pre><code>query.setFirstResult(int1).setMaxResult(int2);
  </code></pre>
  
  <p>I don't know how to write this query. I searched the posts ,can't find answers, so can anybody give me any advice? thanks.</p>