title: On delete set null in hibernate in @OneToMany
body: <p>I have a Department entity which relations are as follows:</p>
  
  <ol>
  <li><p><strong>Many departments</strong> can be in <strong>one parent department</strong>:</p>
  
  <pre><code>@ManyToOne
  @JoinColumn(name = "ik_parent_department_id")
  private Department parentDepartment;
  </code></pre></li>
  <li><p><strong>One parent department</strong> can have <strong>many departments</strong>:</p>
  
  <pre><code>@OneToMany(mappedBy = "parentDepartment")
  private Set&lt;Department&gt; children = new HashSet&lt;Department&gt;(0);
  </code></pre></li>
  </ol>
  
  <p>And I want to implement the next: When I <strong>delete</strong> a <strong>department</strong>, then the <strong>ik_parent_department_id</strong> parameter of all <strong>children</strong> of this <strong>department</strong> is set to <strong>null</strong>. Any ideas how to do that?</p>