title: Creating new entities and changing an entity in prePersist
body: <p>in a sense I would like to transfer my old question <a href="https://stackoverflow.com/questions/52460477/flushing-in-postpersist-possible-or-not">Flushing in postPersist possible or not?</a> to the <code>prePersist</code>event.</p>
  
  <p>Suppose the following example</p>
  
  <pre><code>class Entity {
  
      /** @PrePersist */
      public function doStuffOnPrePersist(LifecycleEventArgs $args)
      {
          $this-&gt;value = 'changed from prePersist callback!';
          $other  = new OtherEntity();
  
          $args-&gt;getEntityManager()-&gt;persist($other);
      }
  }
  </code></pre>
  
  <p>called like </p>
  
  <pre><code>$entity = new Entity();
  $entity-&gt;value = "unchanged";
  $em-&gt;persist($entity);
  $em-&gt;flush();
  </code></pre>
  
  <p>I have 2 fundamental questions:</p>
  
  <h2>- Will the <code>value</code> written to db be "unchanged" or "Changed from..."?</h2>
  
  <h2>- Will the <code>OtherEntity</code> be written to DB?</h2>
  
  <p>Assuming both questions are answered with yes, let me extend my question:</p>
  
  <p>Both, <code>Entity</code> and <code>OtherEntity</code> have an Autogenerated id field and <code>OtherEntity</code> has a reference (ManyToOne) to <code>Entity</code>:</p>
  
  <pre><code>class Entity {
      /* 
       * @ORM\Column(name="id", type="integer")
       * @ORM\Id
       * @ORM\GeneratedValue
       */
      private $id;
  
      /** @PrePersist */
      public function doStuffOnPrePersist(LifecycleEventArgs $args)
      {
          $this-&gt;value = 'changed from prePersist callback!';
          $other  = new OtherEntity();
          $other-&gt;father = $this;    // &lt;-------------
          $args-&gt;getEntityManager()-&gt;persist($other);
      }
  }
  </code></pre>
  
  <h2>Will this work, too?</h2>