title: JPA Named Queries vs Criteria API?
body: <p>Is there a heuristic/best practice/ruleset for a decision between the <strong>Criteria API</strong> and <strong>NamedQuery</strong>?</p>
  
  <p>My thoughts so far :<br> 
  Named queries are generally more readable. Criteria queries are more flexible. <br>
  Both are precompiled. I tend to rely on using named queries as long as possible, then changing to criteria. <br><br>But maybe 
  the urge to "flexify" the query by using the criteria API is a hint to suboptimal design (i.e. separation of concerns)?</p>
  
  <p>Thank you</p>