title: How can I disable Doctrine persist cascade with annotation?
body: <p>Consider two classes like below:</p>
  
  <pre><code>/**
   * @ORM\Table(name="notifications")
   */
  class Notification {
  
      /**
       * @var integer
       *
       * @ORM\Column(name="uid", type="integer")
       * @ORM\Id
       * @ORM\GeneratedValue(strategy="IDENTITY")
       */
      private $id;
  
      /**
       * @ORM\ManyToOne(targetEntity="Task")
       * @ORM\JoinColumn(name="task_id", referencedColumnName="id", onDelete="CASCADE")
       */
      private $task;
  
  }
  
  
  /**
   * @ORM\Table(name="tasks")
   */
  class Task {
  
      /**
       * @var integer
       *
       * @ORM\Column(name="uid", type="integer")
       * @ORM\Id
       * @ORM\GeneratedValue(strategy="IDENTITY")
       */
      private $id;
  
      /**
       * @var integer
       *
       * @ORM\Column(name="status", type="smallint")
       */
      private $status;
  
  }
  </code></pre>
  
  <p>In my controller I have</p>
  
  <pre><code>$task = $em-&gt;getRepository("AppBundle:Task")-&gt;find(1);
  $task-&gt;setStatus(1);
  
  $notification = new Notification();
  $notification-&gt;setTask($task);
  
  $em-&gt;persist($notification);
  $em-&gt;flush();
  </code></pre>
  
  <p>My question is how to avoid persisting <code>task</code> when I persist <code>$notification</code>? with code above it also changes the <code>task</code> status to 1. </p>
  
  <p>I know I can do something like below but I was wondering if it is possible to do it with annotation? </p>
  
  <pre><code>$em-&gt;flush($notification);
  </code></pre>
  
  <p>Why does Doctrine persist the other side of <code>ManyToOne</code>? </p>