title: Set parent account id to null, when removing child
body: <p>i've got the following problem:</p>
  
  <p>I've got class Parent and class Child</p>
  
  <p>Parent can have a child (but can also exist without one), and child must have it's parent.</p>
  
  <p>I want to achieve the following scenario:</p>
  
  <p>Delete child so parent doesn't have this child anymore (e.g. child is set to null in parent class)</p>
  
  <p>Is it about cascadeType or something else? And how can i achieve it?</p>
  
  <pre><code>import ...
  @Table(name = "childtable")
  public class Child{
  
      @Id
      @GeneratedValue(...)
      @SequenceGenerator(...)
      @Column(name = "id", nullable = false)
      private Integer id;
  
      ... some fields ...
  
      @OneToOne(mappedBy = "childrenSomething", cascade = CascadeType.PERSIST)
      @JsonManagedReference
      private Parent parent;
      ...
  }
  
  import ...
  @Entity
  @Table(name = "parenttable")
  public class Parent implements Serializable {
  
      @Id
      private String ID;
  
      ... some fields ...
  
      @OneToOne(cascade = CascadeType.REMOVE)
      @JoinColumn(name="childID", nullable = true, referencedColumnName = "id")
      @JsonBackReference
      Child childrenSomething;
  
  
  }
  
  </code></pre>