title: JPA One-Many Relation child table row not getting deleted
body: <p>I have 2 entity Order and Item, and they are related as 1:N, Order is parent table and item is child table. when I delete an Order, I want the corresponding Items to deleted too. but its not happening, rather it is setting OrderId in child table as "null". This is creating orphan rows in the database in the Item table.</p>
  
  <p>Here is my configuration: I am using Spring, Hibernate as JPAVendor and mysql database</p>
  
  <pre><code>
  @Entity
  @Table(name="T_ORDER")
  public class Order {
  
      @Id
      @GeneratedValue(strategy=GenerationType.AUTO)
      private Long id;
  
      private String customer;
  
      @OneToMany(cascade=CascadeType.ALL)
      @JoinColumn(name="ORDER_ID")
      private Collection items = new LinkedHashSet();
  }
  </code></pre>
  
  <p>Item Entity</p>
  
  <pre><code>
  @Entity
  public class Item {
  
      @Id
      @GeneratedValue(strategy=GenerationType.AUTO)
      private Long id;
  
      @ManyToOne
      private Order order;
  
      private String product;
  
      private double price;
  
      private int quantity;
  </code></pre>
  
  <p>I have only 2JPA properties set</p>
  
  <pre><code>
  key="hibernate.show_sql"=true 
  key="hibernate.hbm2ddl.auto"
  </code></pre>
  
  <p>Not able to figure out wht else needs to be done to solve this problem.</p>