title: Doctrine2 findBy() order by joined table field
body: <p>I use Symfony2 with Doctrine2. There are the following entities:</p>
  
  <pre><code>/**
   * Person
   *
   * @ORM\Entity(repositoryClass="Acme\Bundle\ConsysBundle\Entity\PersonRepository")
   * @ORM\HasLifecycleCallbacks
   * @ORM\Table(name="person")
   */
  class Person
  {
      /**
       * @var integer
       *
       * @ORM\Column(name="id", type="integer")
       * @ORM\Id
       * @ORM\GeneratedValue(strategy="AUTO")
       */
      private $id;
  
      /**
       * 
       * @ORM\ManyToOne(targetEntity="Company", inversedBy="persons", fetch="EAGER")
       * @ORM\JoinColumn(name="company_id", referencedColumnName="id", onDelete="SET NULL")
       */
      private $company;
  
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>/**
   * Company
   *
   * @ORM\Entity(repositoryClass="Acme\Bundle\ConsysBundle\Entity\CompanyRepository")
   * @ORM\HasLifecycleCallbacks
   * @ORM\Table(name="company")
   */
  class Company
  {
      /**
       * @var integer
       *
       * @ORM\Column(name="id", type="integer")
       * @ORM\Id
       * @ORM\GeneratedValue(strategy="AUTO")
       */
      private $id;
  
      /**
       * @var string
       *
       * @ORM\Column(name="name", type="string", length=255, unique=true)
       */
      private $name;
  }
  </code></pre>
  
  <p>Now in my controller I need to do the following:</p>
  
  <pre><code>    $repository = $this-&gt;getDoctrine()-&gt;getRepository('AcmeConsysBundle:Person');
      $people = $repository-&gt;findBy(
              array(),
              // here I want to order by the company name
              // that is taken from the Company entity
              array('company.name' =&gt; 'asc') 
      );
  </code></pre>
  
  <p>This code of course doesn't work, saying that "company.name" is unrecognized. But then how can I order by that column? Is it possible to do using findBy()?</p>