title: Symfony2, doctrine limit and offset doesn't work as expected
body: <p>I'm trying to get results from my table using limit and offsett from my table, and this table has a relations with another two tables.. one of them is MayToOne and the other is OneToOne</p>
  
  <p>If I don't use setFirstResult and setMaxResults the results are the expected because return the information of my table and the information of the other tables related but using setFirst.. and setMax.. only return the information of the table and not the information of the tables related.</p>
  
  <pre><code>$query = $this-&gt;repository-&gt;createQueryBuilder('p')
                  -&gt;where('LOWER(p.name) LIKE LOWER(:term)')
                  -&gt;orWhere('LOWER(p.summary) LIKE LOWER(:term)')
                  -&gt;orwhere('LOWER(p.description) LIKE LOWER(:term)')
                  -&gt;setParameter('term', '%'.$parameters['term'].'%')
                  -&gt;setFirstResult($offset)
                  -&gt;setMaxResults($limit)
                  -&gt;orderBy('p.id','DESC')
                  -&gt;getQuery();
  
  $attractions = $query-&gt;getResult();
  </code></pre>
  
  <p>And I'm trying with paginator using this query:</p>
  
  <pre><code>$query = $this-&gt;repository-&gt;createQueryBuilder('p')
                  -&gt;where('LOWER(p.name) LIKE LOWER(:term)')
                  -&gt;orWhere('LOWER(p.summary) LIKE LOWER(:term)')
                  -&gt;orwhere('LOWER(p.description) LIKE LOWER(:term)')
                  -&gt;setParameter('term', '%'.$parameters['term'].'%')
                  -&gt;setFirstResult($offset)
                  -&gt;setMaxResults($limit)
                  -&gt;orderBy('p.id','DESC');
  
  $attractions = new Paginator($query, $fetchJoinCollection = true);
  </code></pre>
  
  <p>But is not working because appear this error:</p>
  
  <pre><code>[Semantical Error] The annotation "@Enum" in property Doctrine\ORM\Mapping\GeneratedValue::$strategy was never imported. Did you maybe forget to add a "use" statement for this annotation?
  </code></pre>
  
  <p><strong>Entity</strong></p>
  
  <pre><code>    &lt;?php
  
  namespace Acme\MyBundle\Entity;
  
  use Doctrine\ORM\Mapping as ORM;
  use Acme\MyBundle\Model\AttractionInterface;
  
  use Gedmo\Mapping\Annotation as Gedmo;
  
  use JMS\Serializer\Annotation\ExclusionPolicy;
  use JMS\Serializer\Annotation\Exclude;
  use JMS\Serializer\Annotation\Expose;
  use JMS\Serializer;
  
  /**
   * Attraction
   *
   * @ORM\Table(name="attractions")
   * @ORM\Entity
   *
   * @ExclusionPolicy("all") 
   */
  class Attraction implements AttractionInterface
  {
      /**
       * @var integer
       *
       * @ORM\Column(name="id", type="integer")
       * @ORM\Id
       * @ORM\GeneratedValue(strategy="AUTO")
       * @Expose
       */
      private $id;
  
      /**
       * @var string
       *
       * @ORM\Column(name="name", type="string", length=150, nullable=false)
       * @Expose
       */
      private $name;
  
      /**
       * @var string
       *
       * @ORM\Column(name="latitude", type="string", length=30, nullable=false)
       * @Expose
       */
      private $latitude;
  
      /**
       * @var string
       *
       * @ORM\Column(name="longitude", type="string", length=30, nullable=false)
       * @Expose
       */
      private $longitude;
  
      /**
       * @var string
       *
       * @ORM\Column(name="summary", type="text", nullable=false)
       * @Expose
       */
      private $summary;
  
      /**
       * @var string
       *
       * @ORM\Column(name="description", type="text", nullable=true)
       * @Expose
       */
      private $description;
  
      /**
       * @var integer
       *
       * @ORM\Column(name="available_places", type="smallint")
       * @Expose
       */
      private $availablePlaces;
  
      /**
       * @var float
       *
       * @ORM\Column(name="original_price", type="float", nullable=false)
       * @Expose
       */
      private $originalPrice;
  
      /**
       * @var float
       *
       * @ORM\Column(name="new_price", type="float", nullable=false)
       * @Expose
       */
      private $newPrice;
  
      /**
       * @var \DateTime
       *
       * @ORM\Column(name="starting_point", type="datetime", nullable=false)
       * @Expose
       */
      private $startingPoint;
  
      /**
       * @var string
       *
       * @ORM\Column(name="picture", type="string", length=50, nullable=false)
       * @Expose
       */
      private $picture;
  
      /**
       * @var integer
       *
       * @ORM\ManyToOne(targetEntity="Vendor")
       * @ORM\JoinColumn(name="vendor", referencedColumnName="id")
       * @Expose
       */
      private $vendor;
  
      /**
       * @var integer
       *
       * @ORM\OneToOne(targetEntity="Category")
       * @ORM\JoinColumn(name="category", referencedColumnName="id")
       * @Expose
       */
      private $category;
  
      /**
       * @var \DateTime
       *
       * @ORM\Column(name="created_at", type="datetime", options={"default" = "CURRENT_TIMESTAMP"}, nullable=true)
       * @Gedmo\Timestampable(on="create")
       * @Expose
       */
      private $createdAt;
  
      /**
       * @var \DateTime
       *
       * @ORM\Column(name="updated_at", type="datetime", options={"default" = "CURRENT_TIMESTAMP"}, nullable=true)
       * @Expose
       */
      private $updatedAt;
  
  
      public function __toString()
      {
          return $this-&gt;name;
      }
  
      /**
       * Get id
       *
       * @return integer 
       */
      public function getId()
      {
          return $this-&gt;id;
      }
  
      /**
       * Set name
       *
       * @param string $name
       * @return Attraction
       */
      public function setName($name)
      {
          $this-&gt;name = $name;
  
          return $this;
      }
  
      /**
       * Get name
       *
       * @return string 
       */
      public function getName()
      {
          return $this-&gt;name;
      }
  
      /**
       * Set latitude
       *
       * @param string $latitude
       * @return Attraction
       */
      public function setLatitude($latitude)
      {
          $this-&gt;latitude = $latitude;
  
          return $this;
      }
  
      /**
       * Get latitude
       *
       * @return string 
       */
      public function getLatitude()
      {
          return $this-&gt;latitude;
      }
  
      /**
       * Set longitude
       *
       * @param string $longitude
       * @return Attraction
       */
      public function setLongitude($longitude)
      {
          $this-&gt;longitude = $longitude;
  
          return $this;
      }
  
      /**
       * Get longitude
       *
       * @return string 
       */
      public function getLongitude()
      {
          return $this-&gt;longitude;
      }
  
      /**
       * Set summary
       *
       * @param string $summary
       * @return Attraction
       */
      public function setSummary($summary)
      {
          $this-&gt;summary = $summary;
  
          return $this;
      }
  
      /**
       * Get summary
       *
       * @return string 
       */
      public function getSummary()
      {
          return $this-&gt;summary;
      }
  
      /**
       * Set description
       *
       * @param string $description
       * @return Attraction
       */
      public function setDescription($description)
      {
          $this-&gt;description = $description;
  
          return $this;
      }
  
      /**
       * Get description
       *
       * @return string 
       */
      public function getDescription()
      {
          return $this-&gt;description;
      }
  
      /**
       * Set availablePlaces
       *
       * @param integer $availablePlaces
       * @return Attraction
       */
      public function setAvailablePlaces($availablePlaces)
      {
          $this-&gt;availablePlaces = $availablePlaces;
  
          return $this;
      }
  
      /**
       * Get availablePlaces
       *
       * @return integer 
       */
      public function getAvailablePlaces()
      {
          return $this-&gt;availablePlaces;
      }
  
      /**
       * Set originalPrice
       *
       * @param float $originalPrice
       * @return Attraction
       */
      public function setOriginalPrice($originalPrice)
      {
          $this-&gt;originalPrice = $originalPrice;
  
          return $this;
      }
  
      /**
       * Get originalPrice
       *
       * @return float 
       */
      public function getOriginalPrice()
      {
          return $this-&gt;originalPrice;
      }
  
      /**
       * Set newPrice
       *
       * @param float $newPrice
       * @return Attraction
       */
      public function setNewPrice($newPrice)
      {
          $this-&gt;newPrice = $newPrice;
  
          return $this;
      }
  
      /**
       * Get newPrice
       *
       * @return float 
       */
      public function getNewPrice()
      {
          return $this-&gt;newPrice;
      }
  
      /**
       * Set startingPoint
       *
       * @param \DateTime $startingPoint
       * @return Attraction
       */
  
      public function setStartingPoint($startingPoint)
      {
          $this-&gt;startingPoint = \DateTime::createFromFormat('Y-m-d H:i:s', $startingPoint);
  
          return $this;
      }
  
      /**
       * Get startingPoint
       *
       * @return \DateTime 
       */
      public function getStartingPoint()
      {
          return $this-&gt;startingPoint;
      }
  
      /**
       * Set picture
       *
       * @param string $picture
       * @return Attraction
       */
      public function setPicture($picture)
      {
          $this-&gt;picture = $picture;
  
          return $this;
      }
  
      /**
       * Get picture
       *
       * @return string 
       */
      public function getPicture()
      {
          return $this-&gt;picture;
      }
  
      /**
       * Set vendor
       *
       * @param integer $vendor
       * @return Attraction
       */
      public function setVendor($vendor)
      {
          $this-&gt;vendor = $vendor;
  
          return $this;
      }
  
      /**
       * Get vendor
       *
       * @return integer 
       */
      public function getVendor()
      {
          return $this-&gt;vendor;
      }
  
      /**
       * Set category
       *
       * @param integer $category
       * @return Attraction
       */
      public function setCategory($category)
      {
          $this-&gt;category = $category;
  
          return $this;
      }
  
      /**
       * Get categoryId
       *
       * @return integer 
       */
      public function getCategory()
      {
          return $this-&gt;category;
      }
  
      /**
       * Set createdAt
       *
       * @param \DateTime $createdAt
       * @return Attraction
       */
      public function setCreatedAt($createdAt)
      {
          $this-&gt;createdAt = $createdAt;
  
          return $this;
      }
  
      /**
       * Get createdAt
       *
       * @return \DateTime 
       */
      public function getCreatedAt()
      {
          return $this-&gt;createdAt;
      }
  
      /**
       * Set updatedAt
       *
       * @param \DateTime $updatedAt
       * @return Attraction
       */
      public function setUpdatedAt($updatedAt)
      {
          $this-&gt;updatedAt = $updatedAt;
  
          return $this;
      }
  
      /**
       * Get updatedAt
       *
       * @return \DateTime 
       */
      public function getUpdatedAt()
      {
          return $this-&gt;updatedAt;
      }
  }
  </code></pre>