title: Doctrine DQL: how to get expression to inversed side
body: <p>I wish to fetch an entity where the inversed association does not exist (on a 1:1 association)</p>
  
  <p>I get the error:</p>
  
  <blockquote>
    <p>A single-valued association path expression to an inverse side is not supported in DQL queries. Use an
      explicit join instead.</p>
  </blockquote>
  
  <p>Query:</p>
  
  <pre><code>$query = $this-&gt;getEntityManager()-&gt;createQuery("
                  SELECT DISTINCT(p.date)
                  FROM MainBundle:Price p
                  WHERE p.emaPrice IS NULL
                  ORDER BY p.date ASC
              ")
              -&gt;setMaxResults(1);
          $date = $query-&gt;getOneOrNullResult();
  </code></pre>
  
  <p>I understand the error, but I'm really stuck on fixing it. I've read I should add an explicit JOIN, but I've added it and still no luck. </p>
  
  <p><strong>EDIT</strong>
  query with join:</p>
  
  <pre><code>$query = $this-&gt;getEntityManager()-&gt;createQuery("
          SELECT DISTINCT(p.date)
          FROM MainBundle:Price p
          JOIN MomentumBundle:EmaPrice ep
          WITH ep.id = p.emaPrice
          WHERE p.emaPrice IS NULL
          ORDER BY p.date ASC
      ")
      -&gt;setMaxResults(1);
  $date = $query-&gt;getOneOrNullResult();
  </code></pre>