title: hibernate restrictions and/or order
body: <p>small questions about Restrictions.or and Restrictions.and</p>
  
  <p>If I do something like this:</p>
  
  <pre><code>...
  criterion = criterionA;
  criterion = Restrictions.and(criterion, criterionB);
  criterion = Restrictions.or(criterion, criterionC);
  criterion = Restrictions.and(criterion, criterionD);
  </code></pre>
  
  <p>Will this be treated as:</p>
  
  <pre><code>(A and B) or (C and D) (following mathematical conventions)
  </code></pre>
  
  <p>Or will it be treated in the order it the restrictions have been added:</p>
  
  <pre><code>(((A and B) or C) and D)
  </code></pre>
  
  <p>Please also add references if there are any...</p>