title: Symfony2 Doctrine Expr 'IS NOT NULL'
body: <p>I'm using the <strong>FormType</strong> for an <strong>Entity</strong> of mine, and setting up an <a href="http://symfony.com/doc/2.1/reference/forms/types/entity.html" rel="nofollow noreferrer">entity field</a>.
  I need two <code>Where</code> clauses in an <code>And</code>, and from what I've read on <a href="http://docs.doctrine-project.org/en/2.0.x/reference/query-builder.html" rel="nofollow noreferrer">the Query Builder page</a>, this is at least how I should go about it:</p>
  
  <pre><code>'query_builder' =&gt; function ($er){
      $qb = $er-&gt;createQueryBuilder('p');
      $qb
          -&gt;where($qb-&gt;expr()-&gt;andx(
              $qb-&gt;expr()-&gt;in('p', '?1'),
              $qb-&gt;expr()-&gt;not(
                  $qb-&gt;expr()-&gt;eq('p.location', 'NULL')
              )
          ))
          -&gt;setParameter(1, $this-&gt;totalScope)
      ;
      return $qb;
  },
  </code></pre>
  
  <p>However, the <code>not(eq('col', 'NULL'))</code> doesn't achieve the desired result, and in fact, errors with:</p>
  
  <blockquote>
    <p>Error: Expected Literal, got 'NULL'</p>
  </blockquote>