title: JPA select query with where clause
body: <p>I want to write a select statement but can't figure out how to write the where clause...</p>
  
  <p>My code:</p>
  
  <pre><code>CriteriaQuery query = entityManager.getCriteriaBuilder().createQuery();
  query.select(query.from(SecureMessage.class)).where();
  </code></pre>
  
  <p>This is within a method that I am passing a string to. I want to fetch only the rows that match the value of the string that Im passing to the method.</p>