title: JPA: Cascade remove does not delete child
body: <p>Edit: Modifying the question to better reflect the problem. Originally posted question <a href="http://pastebin.com/Z2tzh71G" rel="nofollow">here</a></p>
  
  <p>I have a parent (<code>Context</code>) and a child (<code>User</code>) entity (ManyToOne relationship). Cascade 'REMOVE' on the parent is not deleting the child. Code as below:</p>
  
  <pre><code>//Owning side - child
  @Entity
  public class User {
      @Id
      @GeneratedValue(strategy = GenerationType.AUTO)
      private int id;
      @Column(name = DBColumns.USER_NAME)
      private String name;
      @ManyToOne
      @JoinColumn(name = DBColumns.CONTEXT_ID)
      private Context context;
  }
  
  //parent
  @Entity
  public class Context {
      @Id
      @GeneratedValue(strategy = GenerationType.AUTO)
      private int id;
      @Column(name = DBColumns.CONTEXT_NAME)
      private String name;
      @OneToMany(mappedBy = "context", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE, orphanRemoval = true)
      private Set&lt;User&gt; users = new HashSet&lt;User&gt;();
  }
  
  //usage
  Context sampleContext = new Context("sampleContext");
  em.persist(sampleContext);
  User sampleUser = new User(sampleContext, "sampleUser");
  em.persist(sampleUser);
  em.remove(sampleContext); //should remove user as well but throws foreign key dependency error
  </code></pre>