9 Replies Latest reply: Jan 27, 2012 1:15 AM by Suganth RSS

    trying to delete child's row overriding parent's doDML()

    MarioK
      Hi
      I have to delete a row and possible childs when user invoke Delete operation button from jsf.
      I'm not sure if this is the best approach to do it, but I overrided a doDML method in entity implementation:
      protected void doDML(int operation, TransactionEvent e) {
         if (operation == DML_DELETE) {
            RowIterator ri = getChild();
            Row row;
            while ((row = ri.next()) != null) {
               row.remove();
            }
         }    
         super.doDML(operation, e);
      }
      And it does not work: "ORA-02292: integrity constraint violated - child record found"
      Advice?
      Thanx
      (note: in this usecase I cannot use "Implement Cascade Delete" behavior of association)