title: Spring JPA ManyToOne deletion handle
body: <p>I have two POJOs, one is for <strong>Post</strong> which is below</p>
  <pre><code>@Entity
  public class Post {
      ...
      @ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
      @JoinColumn(name = &quot;category_id&quot;)
      private Category category;
      ...
  }
  </code></pre>
  <p>and another one is for Category as below</p>
  <pre><code>@Entity(name = &quot;category&quot;)
  public class Category {
      ...
      @OneToMany(fetch = FetchType.LAZY, mappedBy = &quot;category&quot;, cascade = CascadeType.ALL)
      @JsonIgnore
      private List&lt;Post&gt; post;
      ...
  }
  </code></pre>
  <p>I have two crud repositories for each class. And here is my issue. <code>GET, POST, PUT</code> is working as expected. But for <code>DELETE</code> it is creating the issue. Suppose <em><strong>POST A</strong></em> has Category type C. When I am trying to delete <em><strong>POST A</strong></em> it is not only deleting <em><strong>POST A</strong></em> itself also deleting <em><strong>Category C</strong></em> and all Posts related to <em><strong>Category C</strong></em>.</p>
  <p>Please help :)</p>