Delete Child Record on Delete of Master Record in ADF

Hi All,

In this post I am going to show you how you can delete child record along with master record in ADF.

There are multiple way to do this.

1) By doing configuration in Association
2) By Overriding remove method in EntityImpl Class
3) By Overriding remove method in VOROImpl Class

 1) By doing configuration in Association

To delete the child record of detail table on deleting of master table record through association you have to check the property "Implement Cascade Delete in association as follows:



2) By Overriding remove method in EntityImpl Class

     /**
     * Add entity remove logic in this method.
     */
    public void remove() {
        RowIterator ri=getEmployeesEO();
        while(ri.hasNext()){
            ri.next().remove();
        }
        super.remove();
    }



 3) By Overriding remove method in VOROImpl Class

    /**
     * Add view object row remove logic in this method.
     */

    @Override
    public void remove() {
        RowIterator ri=getEmployeesVO();
        while(ri.hasNext()){
            ri.next().remove();
        }
        super.remove();
    }


Happy Coding :)

Comments

Popular posts from this blog

Setting up the environment for Angular2 and Hello World Example in Angular2

Showing number of rows or row count on top and bottom of table in ADF.

Build a Simple ReactJS application using react-cli