Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' into demonolithize

  • Loading branch information...
commit 3a937a17cda0cc237946c38751f39090909c37de 2 parents d365aea + bc237e7
@rentzsch authored
View
2  mogeneratorTestMule/MOs/_ChildMO.h
@@ -11,6 +11,8 @@
@interface _ChildMO : HumanMO {}
+ (id)insertInManagedObjectContext:(NSManagedObjectContext*)moc_;
++ (NSString*)entityName;
++ (NSEntityDescription*)entityInManagedObjectContext:(NSManagedObjectContext*)moc_;
- (ChildMOID*)objectID;
View
9 mogeneratorTestMule/MOs/_ChildMO.m
@@ -13,6 +13,15 @@ + (id)insertInManagedObjectContext:(NSManagedObjectContext*)moc_ {
return [NSEntityDescription insertNewObjectForEntityForName:@"Child" inManagedObjectContext:moc_];
}
++ (NSString*)entityName {
+ return @"Child";
+}
+
++ (NSEntityDescription*)entityInManagedObjectContext:(NSManagedObjectContext*)moc_ {
+ NSParameterAssert(moc_);
+ return [NSEntityDescription entityForName: @"Child" inManagedObjectContext: moc_];
+}
+
- (ChildMOID*)objectID {
return (ChildMOID*)[super objectID];
}
View
2  mogeneratorTestMule/MOs/_HumanMO.h
@@ -11,6 +11,8 @@
@interface _HumanMO : MyBaseClass {}
+ (id)insertInManagedObjectContext:(NSManagedObjectContext*)moc_;
++ (NSString*)entityName;
++ (NSEntityDescription*)entityInManagedObjectContext:(NSManagedObjectContext*)moc_;
- (HumanMOID*)objectID;
View
9 mogeneratorTestMule/MOs/_HumanMO.m
@@ -13,6 +13,15 @@ + (id)insertInManagedObjectContext:(NSManagedObjectContext*)moc_ {
return [NSEntityDescription insertNewObjectForEntityForName:@"Human" inManagedObjectContext:moc_];
}
++ (NSString*)entityName {
+ return @"Human";
+}
+
++ (NSEntityDescription*)entityInManagedObjectContext:(NSManagedObjectContext*)moc_ {
+ NSParameterAssert(moc_);
+ return [NSEntityDescription entityForName: @"Human" inManagedObjectContext: moc_];
+}
+
- (HumanMOID*)objectID {
return (HumanMOID*)[super objectID];
}
View
2  mogeneratorTestMule/MOs/_ParentMO.h
@@ -11,6 +11,8 @@
@interface _ParentMO : HumanMO {}
+ (id)insertInManagedObjectContext:(NSManagedObjectContext*)moc_;
++ (NSString*)entityName;
++ (NSEntityDescription*)entityInManagedObjectContext:(NSManagedObjectContext*)moc_;
- (ParentMOID*)objectID;
View
9 mogeneratorTestMule/MOs/_ParentMO.m
@@ -13,6 +13,15 @@ + (id)insertInManagedObjectContext:(NSManagedObjectContext*)moc_ {
return [NSEntityDescription insertNewObjectForEntityForName:@"Parent" inManagedObjectContext:moc_];
}
++ (NSString*)entityName {
+ return @"Parent";
+}
+
++ (NSEntityDescription*)entityInManagedObjectContext:(NSManagedObjectContext*)moc_ {
+ NSParameterAssert(moc_);
+ return [NSEntityDescription entityForName: @"Parent" inManagedObjectContext: moc_];
+}
+
- (ParentMOID*)objectID {
return (ParentMOID*)[super objectID];
}
View
1  mogeneratorTestMule/mogeneratorTestMule_AppDelegate.m
@@ -7,6 +7,7 @@ - (void)applicationDidFinishLaunching:(NSNotification*)notification_ {
ParentMO *parent = [ParentMO insertInManagedObjectContext:[self managedObjectContext]];
[parent setIvar:42.0];
[parent setHairColor:[NSColor brownColor]];
+ NSAssert([[ParentMO entityName] isEqualToString:@"Parent"], nil);
NSLog(@"success");
[NSApp terminate:nil];
}
View
2  templates/machine.h.motemplate
@@ -11,6 +11,8 @@
@interface _<$managedObjectClassName$> : <$customSuperentity$> {}
+ (id)insertInManagedObjectContext:(NSManagedObjectContext*)moc_;
++ (NSString*)entityName;
++ (NSEntityDescription*)entityInManagedObjectContext:(NSManagedObjectContext*)moc_;
- (<$managedObjectClassName$>ID*)objectID;
<$foreach Attribute noninheritedAttributes do$>
View
9 templates/machine.m.motemplate
@@ -13,6 +13,15 @@
return [NSEntityDescription insertNewObjectForEntityForName:@"<$name$>" inManagedObjectContext:moc_];
}
++ (NSString*)entityName {
+ return @"<$name$>";
+}
+
++ (NSEntityDescription*)entityInManagedObjectContext:(NSManagedObjectContext*)moc_ {
+ NSParameterAssert(moc_);
+ return [NSEntityDescription entityForName:@"<$name$>" inManagedObjectContext:moc_];
+}
+
- (<$managedObjectClassName$>ID*)objectID {
return (<$managedObjectClassName$>ID*)[super objectID];
}
Please sign in to comment.
Something went wrong with that request. Please try again.