title: JPA Criteria API: Difference between two dates in database?
body: <p>Simple Question: I have a (MySQL) table with two date columns (from, until) and ask it with</p>
  
  <pre><code>select * from mytable where until &gt; from + interval 4 week;
  </code></pre>
  
  <p>This is really simple in MySQL.</p>
  
  <p>How could you do that in JPA Query like </p>
  
  <pre><code>cq.where(cb.and(mytable_.get(until),...)
  </code></pre>
  
  <p>EDIT: Both dates come from the database row, I compare two fields of the database and not one field from application with one from database.</p>