Skip to content

Commit

Permalink
[DEV] regenerator test mule files with 1.22 templates
Browse files Browse the repository at this point in the history
  • Loading branch information
rentzsch committed Mar 3, 2011
1 parent 7a67356 commit 70f5d92
Show file tree
Hide file tree
Showing 7 changed files with 326 additions and 26 deletions.
19 changes: 19 additions & 0 deletions mogeneratorTestMule/MOs/_ChildMO.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

@class ParentMO;



@interface ChildMOID : NSManagedObjectID {}
@end

Expand Down Expand Up @@ -34,8 +36,25 @@
+ (NSArray*)fetchByParent:(NSManagedObjectContext*)moc_ parent:(ParentMO*)parent_ error:(NSError**)error_;



@end

@interface _ChildMO (CoreDataGeneratedAccessors)

@end

@interface _ChildMO (CoreDataGeneratedPrimitiveAccessors)


- (NSString*)primitiveChildName;
- (void)setPrimitiveChildName:(NSString*)value;





- (ParentMO*)primitiveParent;
- (void)setPrimitiveParent:(ParentMO*)value;


@end
22 changes: 17 additions & 5 deletions mogeneratorTestMule/MOs/_ChildMO.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,20 @@ + (NSString*)entityName {

+ (NSEntityDescription*)entityInManagedObjectContext:(NSManagedObjectContext*)moc_ {
NSParameterAssert(moc_);
return [NSEntityDescription entityForName: @"Child" inManagedObjectContext: moc_];
return [NSEntityDescription entityForName:@"Child" inManagedObjectContext:moc_];
}

- (ChildMOID*)objectID {
return (ChildMOID*)[super objectID];
}

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


return keyPaths;
}




Expand All @@ -43,6 +50,8 @@ - (ChildMOID*)objectID {





+ (NSArray*)fetchByParent:(NSManagedObjectContext*)moc_ parent:(ParentMO*)parent_ {
NSError *error = nil;
NSArray *result = [self fetchByParent:moc_ parent:parent_ error:&error];
Expand All @@ -56,16 +65,19 @@ + (NSArray*)fetchByParent:(NSManagedObjectContext*)moc_ parent:(ParentMO*)parent
return result;
}
+ (NSArray*)fetchByParent:(NSManagedObjectContext*)moc_ parent:(ParentMO*)parent_ error:(NSError**)error_ {
NSParameterAssert(moc_);
NSError *error = nil;

NSManagedObjectModel *model = [[moc_ persistentStoreCoordinator] managedObjectModel];
NSFetchRequest *fetchRequest = [model fetchRequestFromTemplateWithName:@"byParent"
substitutionVariables:[NSDictionary dictionaryWithObjectsAndKeys:

NSDictionary *substitutionVariables = [NSDictionary dictionaryWithObjectsAndKeys:

parent_, @"parent",

nil]
];
nil];

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

NSArray *result = [moc_ executeFetchRequest:fetchRequest error:&error];
Expand Down
29 changes: 29 additions & 0 deletions mogeneratorTestMule/MOs/_HumanMO.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

@class NSManagedObject;





@interface HumanMOID : NSManagedObjectID {}
@end

Expand Down Expand Up @@ -52,8 +56,33 @@
+ (NSArray*)fetchAllHumans:(NSManagedObjectContext*)moc_ error:(NSError**)error_;



@end

@interface _HumanMO (CoreDataGeneratedAccessors)

@end

@interface _HumanMO (CoreDataGeneratedPrimitiveAccessors)


- (NSData*)primitiveHairColorStorage;
- (void)setPrimitiveHairColorStorage:(NSData*)value;




- (NSString*)primitiveHumanName;
- (void)setPrimitiveHumanName:(NSString*)value;







- (NSManagedObject*)primitiveMeaninglessRelationship;
- (void)setPrimitiveMeaninglessRelationship:(NSManagedObject*)value;


@end
34 changes: 25 additions & 9 deletions mogeneratorTestMule/MOs/_HumanMO.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,20 @@ + (NSString*)entityName {

+ (NSEntityDescription*)entityInManagedObjectContext:(NSManagedObjectContext*)moc_ {
NSParameterAssert(moc_);
return [NSEntityDescription entityForName: @"Human" inManagedObjectContext: moc_];
return [NSEntityDescription entityForName:@"Human" inManagedObjectContext:moc_];
}

- (HumanMOID*)objectID {
return (HumanMOID*)[super objectID];
}

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


return keyPaths;
}




Expand All @@ -52,6 +59,8 @@ - (HumanMOID*)objectID {





+ (NSArray*)fetchByHumanName:(NSManagedObjectContext*)moc_ humanName:(NSString*)humanName_ {
NSError *error = nil;
NSArray *result = [self fetchByHumanName:moc_ humanName:humanName_ error:&error];
Expand All @@ -65,16 +74,19 @@ + (NSArray*)fetchByHumanName:(NSManagedObjectContext*)moc_ humanName:(NSString*)
return result;
}
+ (NSArray*)fetchByHumanName:(NSManagedObjectContext*)moc_ humanName:(NSString*)humanName_ error:(NSError**)error_ {
NSParameterAssert(moc_);
NSError *error = nil;

NSManagedObjectModel *model = [[moc_ persistentStoreCoordinator] managedObjectModel];
NSFetchRequest *fetchRequest = [model fetchRequestFromTemplateWithName:@"byHumanName"
substitutionVariables:[NSDictionary dictionaryWithObjectsAndKeys:

NSDictionary *substitutionVariables = [NSDictionary dictionaryWithObjectsAndKeys:

humanName_, @"humanName",

nil]
];
nil];

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

NSArray *result = [moc_ executeFetchRequest:fetchRequest error:&error];
Expand All @@ -97,14 +109,17 @@ + (id)fetchOneByHumanName:(NSManagedObjectContext*)moc_ humanName:(NSString*)hum
return result;
}
+ (id)fetchOneByHumanName:(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:@"oneByHumanName"
substitutionVariables:substitutionVariables];
NSAssert(fetchRequest, @"Can't find fetch request named \"oneByHumanName\".");
Expand Down Expand Up @@ -147,14 +162,15 @@ + (NSArray*)fetchAllHumans:(NSManagedObjectContext*)moc_ {
return result;
}
+ (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:[NSDictionary dictionaryWithObjectsAndKeys:

nil]
];
substitutionVariables:substitutionVariables];
NSAssert(fetchRequest, @"Can't find fetch request named \"allHumans\".");

NSArray *result = [moc_ executeFetchRequest:fetchRequest error:&error];
Expand Down
131 changes: 131 additions & 0 deletions mogeneratorTestMule/MOs/_ParentMO.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@

@class ChildMO;



@class NSObject;


@class NSColor;









@interface ParentMOID : NSManagedObjectID {}
@end

Expand Down Expand Up @@ -135,6 +150,7 @@




@end

@interface _ParentMO (CoreDataGeneratedAccessors)
Expand All @@ -144,4 +160,119 @@
- (void)addChildrenObject:(ChildMO*)value_;
- (void)removeChildrenObject:(ChildMO*)value_;

@end

@interface _ParentMO (CoreDataGeneratedPrimitiveAccessors)


- (NSNumber*)primitiveMyInt16Transient;
- (void)setPrimitiveMyInt16Transient:(NSNumber*)value;

- (short)primitiveMyInt16TransientValue;
- (void)setPrimitiveMyInt16TransientValue:(short)value_;




- (NSString*)primitiveParentName;
- (void)setPrimitiveParentName:(NSString*)value;




- (NSObject*)primitiveMyTransformableSansClassName;
- (void)setPrimitiveMyTransformableSansClassName:(NSObject*)value;




- (NSDecimalNumber*)primitiveMyDecimal;
- (void)setPrimitiveMyDecimal:(NSDecimalNumber*)value;




- (NSDate*)primitiveMyDate;
- (void)setPrimitiveMyDate:(NSDate*)value;




- (NSColor*)primitiveMyTransformableWithClassName;
- (void)setPrimitiveMyTransformableWithClassName:(NSColor*)value;




- (NSNumber*)primitiveMyBoolean;
- (void)setPrimitiveMyBoolean:(NSNumber*)value;

- (BOOL)primitiveMyBooleanValue;
- (void)setPrimitiveMyBooleanValue:(BOOL)value_;




- (NSNumber*)primitiveMyInt64;
- (void)setPrimitiveMyInt64:(NSNumber*)value;

- (long long)primitiveMyInt64Value;
- (void)setPrimitiveMyInt64Value:(long long)value_;




- (NSNumber*)primitiveMyDouble;
- (void)setPrimitiveMyDouble:(NSNumber*)value;

- (double)primitiveMyDoubleValue;
- (void)setPrimitiveMyDoubleValue:(double)value_;




- (NSNumber*)primitiveMyInt16;
- (void)setPrimitiveMyInt16:(NSNumber*)value;

- (short)primitiveMyInt16Value;
- (void)setPrimitiveMyInt16Value:(short)value_;




- (NSNumber*)primitiveMyFloat;
- (void)setPrimitiveMyFloat:(NSNumber*)value;

- (float)primitiveMyFloatValue;
- (void)setPrimitiveMyFloatValue:(float)value_;




- (NSData*)primitiveMyBinaryData;
- (void)setPrimitiveMyBinaryData:(NSData*)value;




- (NSString*)primitiveMyString;
- (void)setPrimitiveMyString:(NSString*)value;




- (NSNumber*)primitiveMyInt32;
- (void)setPrimitiveMyInt32:(NSNumber*)value;

- (int)primitiveMyInt32Value;
- (void)setPrimitiveMyInt32Value:(int)value_;





- (NSMutableSet*)primitiveChildren;
- (void)setPrimitiveChildren:(NSMutableSet*)value;


@end
Loading

0 comments on commit 70f5d92

Please sign in to comment.