title: How does CriteriaBuilder.equal() treat null values?
body: <p>I expected <code>CriteriaBuilder.equal(Expression&lt;?&gt; x, Object y)</code> to always evaluate to false when <code>y</code> is <code>null</code>, but to my surprise that's not what happens: it evaluates to true for rows where the relevant field is also <code>null</code> (I've only tested this for Strings).</p>
  
  <p>The only thing I've been able to find on this is <a href="http://www.objectdb.com/java/jpa/query/jpql/comparison#Criteria_Query_Comparison_" rel="nofollow">this explanation</a>, which corresponds to my mistaken initial assumption. </p>
  
  <p>What is really happening here? Is <code>CriteriaBuilder.equal(Expression&lt;?&gt; x, Object y)</code> transformed into <code>CriteriaBuilder.isNull(Expression&lt;?&gt; x)</code> when <code>y</code> is <code>null</code>? Are <code>null</code> Strings transformed to <code>'null'</code>? Or am I somehow mistaken?</p>