Skip to content

Commit

Permalink
[DEV] Regenerated TestMule files.
Browse files Browse the repository at this point in the history
  • Loading branch information
rentzsch committed May 10, 2012
1 parent 3d3e344 commit dacfb37
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 19 deletions.
2 changes: 1 addition & 1 deletion mogeneratorTestMule/MOs/_ChildMO.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ extern const struct ChildMOFetchedProperties {



@property (nonatomic, retain) ParentMO* parent;
@property (nonatomic, retain) ParentMO *parent;

//- (BOOL)validateParent:(id*)value_ error:(NSError**)error_;

Expand Down
8 changes: 4 additions & 4 deletions mogeneratorTestMule/MOs/_ChildMO.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ - (ChildMOID*)objectID {
return (ChildMOID*)[super objectID];
}

+ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key {
+ (NSSet*)keyPathsForValuesAffectingValueForKey:(NSString*)key {
NSSet *keyPaths = [super keyPathsForValuesAffectingValueForKey:key];


Expand Down Expand Up @@ -78,19 +78,19 @@ + (NSArray*)fetchByParent:(NSManagedObjectContext*)moc_ parent:(ParentMO*)parent
+ (NSArray*)fetchByParent:(NSManagedObjectContext*)moc_ parent:(ParentMO*)parent_ error:(NSError**)error_ {
NSParameterAssert(moc_);
NSError *error = nil;

NSManagedObjectModel *model = [[moc_ persistentStoreCoordinator] managedObjectModel];

NSDictionary *substitutionVariables = [NSDictionary dictionaryWithObjectsAndKeys:

parent_, @"parent",

nil];

NSFetchRequest *fetchRequest = [model fetchRequestFromTemplateWithName:@"byParent"
substitutionVariables:substitutionVariables];
NSAssert(fetchRequest, @"Can't find fetch request named \"byParent\".");

NSArray *result = [moc_ executeFetchRequest:fetchRequest error:&error];
if (error_) *error_ = error;
return result;
Expand Down
2 changes: 1 addition & 1 deletion mogeneratorTestMule/MOs/_HumanMO.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ extern const struct HumanMOFetchedProperties {



@property (nonatomic, retain) NSManagedObject* meaninglessRelationship;
@property (nonatomic, retain) NSManagedObject *meaninglessRelationship;

//- (BOOL)validateMeaninglessRelationship:(id*)value_ error:(NSError**)error_;

Expand Down
22 changes: 11 additions & 11 deletions mogeneratorTestMule/MOs/_HumanMO.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ - (HumanMOID*)objectID {
return (HumanMOID*)[super objectID];
}

+ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key {
+ (NSSet*)keyPathsForValuesAffectingValueForKey:(NSString*)key {
NSSet *keyPaths = [super keyPathsForValuesAffectingValueForKey:key];


Expand Down Expand Up @@ -89,7 +89,7 @@ + (id)fetchOneByHumanName:(NSManagedObjectContext*)moc_ humanName:(NSString*)hum
+ (id)fetchOneByHumanName:(NSManagedObjectContext*)moc_ humanName:(NSString*)humanName_ error:(NSError**)error_ {
NSParameterAssert(moc_);
NSError *error = nil;

NSManagedObjectModel *model = [[moc_ persistentStoreCoordinator] managedObjectModel];

NSDictionary *substitutionVariables = [NSDictionary dictionaryWithObjectsAndKeys:
Expand All @@ -101,10 +101,10 @@ + (id)fetchOneByHumanName:(NSManagedObjectContext*)moc_ humanName:(NSString*)hum
NSFetchRequest *fetchRequest = [model fetchRequestFromTemplateWithName:@"oneByHumanName"
substitutionVariables:substitutionVariables];
NSAssert(fetchRequest, @"Can't find fetch request named \"oneByHumanName\".");

id result = nil;
NSArray *results = [moc_ executeFetchRequest:fetchRequest error:&error];

if (!error) {
switch ([results count]) {
case 0:
Expand All @@ -120,7 +120,7 @@ + (id)fetchOneByHumanName:(NSManagedObjectContext*)moc_ humanName:(NSString*)hum
results);
}
}

if (error_) *error_ = error;
return result;
}
Expand All @@ -142,15 +142,15 @@ + (NSArray*)fetchAllHumans:(NSManagedObjectContext*)moc_ {
+ (NSArray*)fetchAllHumans:(NSManagedObjectContext*)moc_ error:(NSError**)error_ {
NSParameterAssert(moc_);
NSError *error = nil;

NSManagedObjectModel *model = [[moc_ persistentStoreCoordinator] managedObjectModel];

NSDictionary *substitutionVariables = [NSDictionary dictionary];

NSFetchRequest *fetchRequest = [model fetchRequestFromTemplateWithName:@"allHumans"
substitutionVariables:substitutionVariables];
NSAssert(fetchRequest, @"Can't find fetch request named \"allHumans\".");

NSArray *result = [moc_ executeFetchRequest:fetchRequest error:&error];
if (error_) *error_ = error;
return result;
Expand All @@ -173,19 +173,19 @@ + (NSArray*)fetchByHumanName:(NSManagedObjectContext*)moc_ humanName:(NSString*)
+ (NSArray*)fetchByHumanName:(NSManagedObjectContext*)moc_ humanName:(NSString*)humanName_ error:(NSError**)error_ {
NSParameterAssert(moc_);
NSError *error = nil;

NSManagedObjectModel *model = [[moc_ persistentStoreCoordinator] managedObjectModel];

NSDictionary *substitutionVariables = [NSDictionary dictionaryWithObjectsAndKeys:

humanName_, @"humanName",

nil];

NSFetchRequest *fetchRequest = [model fetchRequestFromTemplateWithName:@"byHumanName"
substitutionVariables:substitutionVariables];
NSAssert(fetchRequest, @"Can't find fetch request named \"byHumanName\".");

NSArray *result = [moc_ executeFetchRequest:fetchRequest error:&error];
if (error_) *error_ = error;
return result;
Expand Down
2 changes: 1 addition & 1 deletion mogeneratorTestMule/MOs/_ParentMO.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ extern const struct ParentMOFetchedProperties {



@property (nonatomic, retain) NSSet* children;
@property (nonatomic, retain) NSSet *children;

- (NSMutableSet*)childrenSet;

Expand Down
9 changes: 8 additions & 1 deletion mogeneratorTestMule/MOs/_ParentMO.m
Original file line number Diff line number Diff line change
Expand Up @@ -50,36 +50,43 @@ - (ParentMOID*)objectID {
return (ParentMOID*)[super objectID];
}

+ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key {
+ (NSSet*)keyPathsForValuesAffectingValueForKey:(NSString*)key {
NSSet *keyPaths = [super keyPathsForValuesAffectingValueForKey:key];

if ([key isEqualToString:@"myBooleanValue"]) {
NSSet *affectingKey = [NSSet setWithObject:@"myBoolean"];
keyPaths = [keyPaths setByAddingObjectsFromSet:affectingKey];
return keyPaths;
}
if ([key isEqualToString:@"myDoubleValue"]) {
NSSet *affectingKey = [NSSet setWithObject:@"myDouble"];
keyPaths = [keyPaths setByAddingObjectsFromSet:affectingKey];
return keyPaths;
}
if ([key isEqualToString:@"myFloatValue"]) {
NSSet *affectingKey = [NSSet setWithObject:@"myFloat"];
keyPaths = [keyPaths setByAddingObjectsFromSet:affectingKey];
return keyPaths;
}
if ([key isEqualToString:@"myInt16Value"]) {
NSSet *affectingKey = [NSSet setWithObject:@"myInt16"];
keyPaths = [keyPaths setByAddingObjectsFromSet:affectingKey];
return keyPaths;
}
if ([key isEqualToString:@"myInt16TransientValue"]) {
NSSet *affectingKey = [NSSet setWithObject:@"myInt16Transient"];
keyPaths = [keyPaths setByAddingObjectsFromSet:affectingKey];
return keyPaths;
}
if ([key isEqualToString:@"myInt32Value"]) {
NSSet *affectingKey = [NSSet setWithObject:@"myInt32"];
keyPaths = [keyPaths setByAddingObjectsFromSet:affectingKey];
return keyPaths;
}
if ([key isEqualToString:@"myInt64Value"]) {
NSSet *affectingKey = [NSSet setWithObject:@"myInt64"];
keyPaths = [keyPaths setByAddingObjectsFromSet:affectingKey];
return keyPaths;
}

return keyPaths;
Expand Down

0 comments on commit dacfb37

Please sign in to comment.