JTObjectMapping
JTObjectMapping copied to clipboard
Grandchildren Mapping
How can I map FieldTemplate and ChildFieldTemplates?
I've tried this but fieldTemplate won't map: NSDictionary *mapping = [NSDictionary dictionaryWithObjectsAndKeys: [SheetTemplate mappingWithKey:@"" mapping:sheetTemplateMapping], @"", [SectionTemplate mappingWithKey:@"SectionTemplates" mapping:sectionTemplateMapping], @"SectionTemplates", [FieldTemplate mappingWithKey:@"fieldTemplates" mapping:fieldTemplateMapping], @"FieldTemplates", nil];
My classes look like this:
@interface SheetTemplate : NSObject
@property int SheetTemplateId; @property(strong) NSString *Title; @property int Version; @property(strong) NSMutableArray *SectionTemplates;
@end
@interface SectionTemplate : NSObject
@property int sectionTemplateId; @property(strong) NSString *title; @property(strong) NSMutableArray *fieldTemplates; @property int sheetTemplateId; @property int rank;
@end
@interface FieldTemplate : NSObject
@property int fieldTemplateId; @property(strong) NSString *label; @property int fieldType; @property int parentFieldTemplateId; @property(strong) NSMutableArray *childFieldTemplates; @property int sectionTemplateId; @property int rank;
@end