public int deleteCascade ( Metadata metadata ) throws SQLException { int count = 0 ; if ( metadata != null ) { // Delete Metadata References and remove parent references MetadataReferenceDao dao = getMetadataReferenceDao ( ) ; dao . deleteByMetadata ( metadata . getId ( ) ) ; dao . removeMetadataParent ( metadata . getId ( ) ) ; // Delete count = delete ( metadata ) ; } return count ; }
Delete the Metadata cascading