title: ORDER BY multiple data(many-to-many) doesn't work
body: <p>I have tables which has manytomany value.</p>
  
  <p>One TagData row has multiple VideoData ids.</p>
  
  <pre><code>class TagData
  {
      /**
       * @var integer
       *
       * @ORM\Column(name="id", type="integer")
       * @ORM\Id
       * @ORM\GeneratedValue(strategy="AUTO")
       */
      private $id;
  
       /**
       * @ORM\Column(type="string",unique=false,nullable=false)
       */
      private $name;
  
  
      /**
      * @ORM\ManyToMany(targetEntity="VideoData", mappedBy="tagIds", cascade={"persist"})
      */
      private $videoIds;
  
      /**
      * Get videos
      *
      * @return \Doctrine\Common\Collections\Collection 
      */
      public function getVideos()
      {
          return $this-&gt;videos;
      }
  </code></pre>
  
  <p>and VideoData table</p>
  
  <pre><code>class VideoData implements ItemInterface
  {
      /**
       * @var integer
       *
       * @ORM\Column(name="id", type="integer")
       * @ORM\Id
       * @ORM\GeneratedValue(strategy="AUTO")
       */
      private $id;
  
      /**
       *
       * @ORM\ManyToMany(targetEntity="Acme\TopBundle\Entity\TagData",inversedBy="videos")
       * @ORM\JoinTable(name="tag_video")
       * )
       */
      private $tagIds;
  
      /**
       * @var \DateTime
       *
       * @ORM\Column(name="updatedAt", type="datetime")
       */
      private $updatedAt;
  </code></pre>
  
  <p>What I want to do is:</p>
  
  <p>Getting VideoIds which belongs to one TagData row, with this conditions </p>
  
  <p>1) sorted by 'updatedAt' </p>
  
  <p>For now, mysql is like this below .</p>
  
  <pre><code>    $query = $em-&gt;createQuery(
          "SELECT t FROM TagData t JOIN t.videoIds v WHERE
          t.id = {$id} order by v.updatedAt");
  </code></pre>
  
  <p>then pick up the videoIds by </p>
  
  <pre><code>$videos = $query-&gt;getVideoIds(); // but this data is not sorted by updatedAt
  </code></pre>
  
  <p>Why this ORDER BY does not working?</p>
  
  <p>How can I make it?</p>