question: public void deleteRule ( long ruleID ) { if ( isClosed ) { throw new IllegalStateException ( TAG + " is closed." ) ; } ruleDbAdapter . delete ( ruleID ) ; Cursor cursorRuleAction = ruleActionDbAdapter . fetchAll ( ruleID , null ) ; while ( cursorRuleAction . moveToNext ( ) ) { long ruleActionID = getLongFromCursor ( cursorRuleAction , RuleActionDbAdapter . KEY_RULEACTIONID ) ; ruleActionDbAdapter . delete ( ruleActionID ) ; Cursor cursorRuleActionParameter = ruleActionParameterDbAdapter . fetchAll ( ruleActionID , null , null ) ; while ( cursorRuleActionParameter . moveToNext ( ) ) { long ruleActionParameterID = getLongFromCursor ( cursorRuleActionParameter , RuleActionParameterDbAdapter . KEY_RULEACTIONPARAMETERID ) ; ruleActionParameterDbAdapter . delete ( ruleActionParameterID ) ; } cursorRuleActionParameter . close ( ) ; } cursorRuleAction . close ( ) ; Cursor cursorFilter = ruleFilterDbAdapter . fetchAll ( ruleID , null , null , null , null , null ) ; while ( cursorFilter . moveToNext ( ) ) { long ruleFilterID = getLongFromCursor ( cursorFilter , RuleFilterDbAdapter . KEY_RULEFILTERID ) ; ruleFilterDbAdapter . delete ( ruleFilterID ) ; } cursorFilter . close ( ) ; }
target:  Delete a rule record as well as ruleAction, ruleActionParameter and ruleFilters records associated with it.