Why setIncludesSubentities:NO in MR_deleteAllMatchingPredicate:inContext: ? #102

Closed
XMLSDK opened this Issue Dec 10, 2011 · 2 comments

Comments

Projects
None yet
2 participants
@XMLSDK

XMLSDK commented Dec 10, 2011

There is one line [request setIncludesSubentities:NO]; within + (BOOL) MR_deleteAllMatchingPredicate:(NSPredicate *)predicate inContext:(NSManagedObjectContext *)context. Is it intentionally not to delete subentities? It seems that if I want to delete all objects in an entity and its subentities, I have to repeatedly call methods like this:

[Animal MR_deleteAllMatchingPredicate...]; // Animals except cats, dogs and horses
[Cat MR_deleteAllMatchingPredicate...];
[Dog MR_deleteAllMatchingPredicate...];
[Horse MR_deleteAllMatchingPredicate...];

It looks like the behavior would be more consistent with fetch if deleteAllMatchingPredicate includes subentities by default. Or providing a method like + (BOOL) MR_deleteAllMatchingPredicate:(NSPredicate *)predicate inContext:(NSManagedObjectContext *)context includingSubentities:(BOOL)includingSubentities to control the delete scope.

@ghost

This comment has been minimized.

Show comment Hide comment
@ghost

ghost Dec 10, 2011

Collaborator

This setting should be removed...I had removed it previously, however it seems to have crept back in somehow...

Collaborator

ghost commented Dec 10, 2011

This setting should be removed...I had removed it previously, however it seems to have crept back in somehow...

@ghost

This comment has been minimized.

Show comment Hide comment
@ghost

ghost Dec 11, 2011

Collaborator

This will be fixed in 1.8.3

Collaborator

ghost commented Dec 11, 2011

This will be fixed in 1.8.3

@ghost ghost closed this Dec 11, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment