title: How to create Criteria on field that can be null?
body: <p>I have to create create <strong>Criteria</strong> or <strong>Criterion</strong> on specific field <strong>myProperity</strong> (on class <strong>MyClass</strong>). I have to choose all objects that have <strong>prop = null</strong> or satisfy <strong>specific Criteria</strong>. So I should make something like:</p>
  
  <pre><code>Criteria criteria = this.sessionManager.getCurrentSession().createCriteria(MyClass.class);
  
  specificCriteria = criteria.createCriteria('myProperity');
  /* definition of specificCriteria */
  
  Disjunction disjunction = Restrictions.disjunction();
  disjunction.add(Restrictions.isNull('myProperity'));
  disjunction.add(specificCriteria);
  
  criteria.add(disjunction);
  </code></pre>
  
  <p>The problem is caused be the facts:</p>
  
  <ol>
  <li>I can't add Criteria to Disjunction (to Disjunction  can be added only a Criterion), so line: disjunction.add(specificCriteria); is wrong</li>
  <li>I can't somehow modify the specificCriteria, to accept null because I can't make criteria on null. (It gives me NullPointerException)</li>
  </ol>
  
  <p>Have you any Idea how to deal with it?</p>