title: HQL: playing with variables
body: <p>I have these testing query:</p>
  
  <pre><code>String query = "";    
  Query criteria;
  query = 
    "from Test t " +
    "where (:value is null OR t.id = :value)"; // update: (t.id = (:value))
  
  criteria = session.createQuery(query);
  
  if (.. some condition ..) {
    criteria.setParameter("value", 0);
  }
  else {
    criteria.setParameter("value", null);
  }
  </code></pre>
  
  <p>How to change the where condition from <code>id = 0</code> to <code>(id = 0 or id = 1)</code> (resp. <code>id &lt; 2</code>) using <code>value</code> parameter only?</p>