title: Hibernate: delete the parent/owner while keeping the child in one-to-one relationship
body: <p>I have two Entity Classes: UserConfirmation and User, they are one-to-one relationship using the following annotated code:</p>
  
  <p><strong>the Parent/Owner Entity (UserConfirmation):</strong></p>
  
  <pre><code>@OneToOne(mappedBy = "userConfirmation", cascade = CascadeType.ALL)
      @JsonManagedReference
      private User user;
  </code></pre>
  
  <p><strong>the Child Entity (User):</strong></p>
  
  <pre><code>@OneToOne
  @JoinColumn(name = "user_confirm_id")
  @JsonBackReference
  private UserConfirmation userConfirmation;
  </code></pre>
  
  <p>With the current <code>Cascade.ALL</code>, when I delete the UserConfirmation, its associated User also gets deleted, which I do not want. I would like to keep the User after deleting the UserConfirmation. </p>
  
  <p><strong>I've tried the following:</strong></p>
  
  <ol>
  <li><p>Set the user to null before deleting UserConfirmation: <code>userConfirmation.setUser(null);</code> but this gives a NullPointerException</p></li>
  <li><p>tried Cascade.REMOVE and almost everything on Cascade, but none works.</p></li>
  </ol>
  
  <p>Your help is appreciated as always :)</p>