title: Symfony Doctrine lazy loading the second child from OneToOne relations
body: <p>I have a very weird question about tweaking and minimizing the database calls by my Symfony application.
  I have 3 related entities, namely (for example) <code>Book</code>, <code>Author</code> and <code>Publisher</code> and they are related by <code>OneToOne</code> relations as shown bellow:</p>
  
  <pre><code>Book
  {
      /**
       * @var Author
       *
       * @ORM\OneToOne(targetEntity="App\Entity\Author", mappedBy="book", cascade={"persist", "remove"})
       */
      private $author;
  }
  </code></pre>
  
  <pre><code>Author
  {
      /**
       * @var Book
       *
       * @ORM\OneToOne(targetEntity="App\Entity\Book", inversedBy="author", cascade={"persist", "remove"})
       */
      private $book;
  
      /**
       * @var Publisher|null
       *
       * @ORM\OneToOne(targetEntity="App\Entity\Publisher", mappedBy="author", cascade={"remove", "persist"}, orphanRemoval=true)
       */
      private $publisher;
  }
  </code></pre>
  
  <pre><code>Publisher
  {
      /**
       * @var Author
       *
       * @ORM\OneToOne(targetEntity="App\Entity\Author", inversedBy="publisher")
       * @ORM\JoinColumn(name="author_id", referencedColumnName="id", nullable=false)
       */
      private $author;
  }
  </code></pre>
  
  <p>Now, if I make a call to fetch all the database records of books as bellow:</p>
  
  <pre><code>$this-&gt;getDoctrine()-&gt;getRepository('AppBundle:Author')-&gt;findAll();
  </code></pre>
  
  <p>it makes only 1 call to the database, but when I try to make the same call for the <code>Book</code> entity in the same way:</p>
  
  <pre><code>$this-&gt;getDoctrine()-&gt;getRepository('AppBundle:Book')-&gt;findAll();
  </code></pre>
  
  <p>it leads to thousand calls.
  From my debugging what I have found is, it makes one call to get all the books but then make a several calls (2558 calls in my case) trying to find the <code>Author-&gt;Publisher</code> relations. This is a great waste of memory, processor, time and performance.</p>
  
  <p>To dig a bit deeper, it seems like (though I am not 100% sure), it is trying to <code>HydrateAllData</code> and makes the unwanted calls here to the database. </p>
  
  <p>Can anybody help me to figure out what is actually happening and how to stop/tweak it please?</p>