5 Replies Latest reply on Nov 4, 2005 6:12 AM by epbernard

    CMP - Cascade delete with mysql does not work!

    jbosschecker

      Hi!,

      I'm working with jboss 4.0.3, mysql 4.1 as Datasource and JBoss-CMP.

      I have an order entity bean, that has a @OneToMany relation to an orderDetail entity, and I want the OrderDetails to be deleted, when I delete one order object.

      I have annotated the OnToMany relation like this:

      @OneToMany(cascade = CascadeType.ALL, mappedBy = "order")
      @JoinColumn(name = "orderId")
      public List<OrderDetail> getOrderDetails() {
      return orderDetails;
      }



      But when I delete an order object, the orderdetails remain in the DB.


      In my persistence.xml file, I set the value of the hibernate.hbm2ddl.auto parameter to 'none',



      but I guess my problem is independent from that entry.

      Am I doing something wrong?
      Has anybody experienced the same problem?