JTObjectMapping icon indicating copy to clipboard operation
JTObjectMapping copied to clipboard

Grandchildren Mapping

Open COSG opened this issue 11 years ago • 0 comments

image

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

COSG avatar Jun 26 '13 05:06 COSG