Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<model userDefinedModelVersionIdentifier="" type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="9525" systemVersion="15D21" minimumToolsVersion="Xcode 7.0">

{{#models}}{{#model}}<entity name="{{{classname}}}ManagedObject" representedClassName="{{{classname}}}ManagedObject" syncable="YES">
{{#isArrayModel}} <relationship name="entries" optional="YES" toMany="YES" deletionRule="Cascade" destinationEntity="{{{arrayModelType}}}ManagedObject" syncable="YES"/>
{{/isArrayModel}}{{^isArrayModel}}{{#vars}}{{#complexType}} <relationship name="{{name}}" {{^required}}optional="YES"{{/required}} {{#isListContainer}}toMany="YES"{{/isListContainer}}{{^isListContainer}}maxCount="1"{{/isListContainer}} deletionRule="Cascade" destinationEntity="{{{complexType}}}ManagedObject" syncable="YES"/>{{/complexType}}{{^complexType}} <attribute name="{{name}}" {{^required}}optional="YES"{{/required}} attributeType="{{#isString}}String{{/isString}}{{#isInteger}}Integer 16{{/isInteger}}{{#isLong}}Double{{/isLong}}{{#isDouble}}Double{{/isDouble}}{{#isFloat}}Float{{/isFloat}}{{#isByteArray}}Binary{{/isByteArray}}{{#isBinary}}Binary{{/isBinary}}{{#isListContainer}}Transformable{{/isListContainer}}{{#isMapContainer}}Transformable{{/isMapContainer}}{{#isBoolean}}Boolean{{/isBoolean}}{{#isDate}}Date{{/isDate}}{{#isDateTime}}Date{{/isDateTime}}" syncable="YES"/>{{/complexType}}{{#vendorExtensions.x-is-unique}}
{{#isArrayModel}} <relationship name="entries" optional="YES" toMany="YES" deletionRule="Cascade" destinationEntity="{{{arrayModelType}}}ManagedObject" syncable="YES"/>
{{/isArrayModel}}{{^isArrayModel}}{{#vars}}{{#complexType}} <relationship name="{{name}}" {{^required}}optional="YES"{{/required}} {{#isListContainer}}toMany="YES" ordered="YES"{{/isListContainer}}{{^isListContainer}}maxCount="1"{{/isListContainer}} deletionRule="Cascade" destinationEntity="{{{complexType}}}ManagedObject" syncable="YES"/>{{/complexType}}{{^complexType}} <attribute name="{{name}}" {{^required}}optional="YES"{{/required}} attributeType="{{#isString}}String{{/isString}}{{#isInteger}}Integer 16{{/isInteger}}{{#isLong}}Double{{/isLong}}{{#isDouble}}Double{{/isDouble}}{{#isFloat}}Float{{/isFloat}}{{#isByteArray}}Binary{{/isByteArray}}{{#isBinary}}Binary{{/isBinary}}{{#isListContainer}}Transformable{{/isListContainer}}{{#isMapContainer}}Transformable{{/isMapContainer}}{{#isBoolean}}Boolean{{/isBoolean}}{{#isDate}}Date{{/isDate}}{{#isDateTime}}Date{{/isDateTime}}" syncable="YES"/>{{/complexType}}{{#vendorExtensions.x-is-unique}}
<uniquenessConstraints><uniquenessConstraint><constraint value="{{name}}"/></uniquenessConstraint></uniquenessConstraints>{{/vendorExtensions.x-is-unique}}
{{/vars}}
{{/isArrayModel}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ NS_ASSUME_NONNULL_BEGIN

@interface {{classname}}ManagedObject : NSManagedObject

@property (nullable, nonatomic, retain) NSSet<{{{arrayModelType}}}ManagedObject*>* entries;
@property (nullable, nonatomic, retain) NSOrderedSet<{{{arrayModelType}}}ManagedObject*>* entries;

{{/isArrayModel}}{{^isArrayModel}}
@interface {{classname}}ManagedObject : {{#parent}}{{{parent}}}ManagedObject{{/parent}}{{^parent}}NSManagedObject{{/parent}}

{{#vars}}
{{#description}}/* {{{description}}} {{^required}}[optional]{{/required}}
*/{{/description}}
@property (nullable, nonatomic, retain) {{^complexType}}{{{ datatype }}}{{/complexType}}{{#complexType}}{{#isListContainer}}NSSet<{{{complexType}}}ManagedObject*>*{{/isListContainer}}{{^isListContainer}}{{#isMapContainer}}{{{ datatype }}}{{/isMapContainer}}{{^isMapContainer}}{{{complexType}}}ManagedObject*{{/isMapContainer}}{{/isListContainer}}{{/complexType}} {{name}};
@property (nullable, nonatomic, retain) {{^complexType}}{{{ datatype }}}{{/complexType}}{{#complexType}}{{#isListContainer}}NSOrderedSet<{{{complexType}}}ManagedObject*>*{{/isListContainer}}{{^isListContainer}}{{#isMapContainer}}{{{ datatype }}}{{/isMapContainer}}{{^isMapContainer}}{{{complexType}}}ManagedObject*{{/isMapContainer}}{{/isListContainer}}{{/complexType}} {{name}};
{{/vars}}
{{/isArrayModel}}
@end
Expand All @@ -31,14 +31,14 @@ NS_ASSUME_NONNULL_BEGIN
{{#isArrayModel}}
- (void)addEntriesObject:({{arrayModelType}}ManagedObject *)value;
- (void)removeEntriesObject:({{arrayModelType}}ManagedObject *)value;
- (void)addEntries:(NSSet<{{{arrayModelType}}}ManagedObject*> *)values;
- (void)removeEntries:(NSSet<{{{arrayModelType}}}ManagedObject*> *)values;
- (void)addEntries:(NSOrderedSet<{{{arrayModelType}}}ManagedObject*> *)values;
- (void)removeEntries:(NSOrderedSet<{{{arrayModelType}}}ManagedObject*> *)values;
{{/isArrayModel}}
{{^isArrayModel}}
{{#vars}}{{#isListContainer}}{{#complexType}}- (void)add{{vendorExtensions.x-uppercaseName}}Object:({{complexType}}ManagedObject *)value;
- (void)remove{{vendorExtensions.x-uppercaseName}}Object:({{complexType}}ManagedObject *)value;
- (void)add{{vendorExtensions.x-uppercaseName}}:(NSSet<{{{complexType}}}ManagedObject*> *)values;
- (void)remove{{vendorExtensions.x-uppercaseName}}:(NSSet<{{{complexType}}}ManagedObject*> *)values;
- (void)add{{vendorExtensions.x-uppercaseName}}:(NSOrderedSet<{{{complexType}}}ManagedObject*> *)values;
- (void)remove{{vendorExtensions.x-uppercaseName}}:(NSOrderedSet<{{{complexType}}}ManagedObject*> *)values;
{{/complexType}}{{/isListContainer}}{{/vars}}
{{/isArrayModel}}
@end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
return;
}
{{#vars}}{{^complexType}} managedObject.{{name}} = [object.{{name}} copy];{{/complexType}}{{#complexType}}{{#isListContainer}} if(object.{{name}}) {
NSMutableSet * convertedObjs = [NSMutableSet set];
NSMutableOrderedSet * convertedObjs = [NSMutableOrderedSet orderedSet];
for (id innerObject in object.{{name}}) {
id convertedObj = [self.{{name}}Builder {{complexType}}ManagedObjectFrom{{complexType}}:innerObject context:managedObject.managedObjectContext];
[convertedObjs addObject:convertedObj];
Expand All @@ -47,7 +47,7 @@
} else {
[self.{{name}}Builder update{{complexType}}ManagedObject:managedObject.{{name}} with{{complexType}}:object.{{name}}];
}{{/isMapContainer}}{{#isMapContainer}}managedObject.{{name}} = [object.{{name}} copy];{{/isMapContainer}}{{/isListContainer}}{{/complexType}}
{{/vars}}{{#isArrayModel}} NSMutableSet * convertedObjs = [NSMutableSet set];
{{/vars}}{{#isArrayModel}} NSMutableOrderedSet * convertedObjs = [NSMutableOrderedSet orderedSet];
for (id innerObject in object) {
id convertedObj = [self.entriesBuilder {{arrayModelType}}ManagedObjectFrom{{arrayModelType}}:innerObject context:managedObject.managedObjectContext];
[convertedObjs addObject:convertedObj];
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/objc/core-data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This ObjC package is automatically generated by the [Swagger Codegen](https://gi

- API version: 1.0.0
- Package version:
- Build date: 2016-08-23T10:56:27.632+02:00
- Build date: 2016-09-06T10:33:51.799+02:00
- Build package: class io.swagger.codegen.languages.ObjcClientCodegen

## Requirements
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,38 @@
<model userDefinedModelVersionIdentifier="" type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="9525" systemVersion="15D21" minimumToolsVersion="Xcode 7.0">

<entity name="SWGCategoryManagedObject" representedClassName="SWGCategoryManagedObject" syncable="YES">
<attribute name="_id" optional="YES" attributeType="Double" syncable="YES"/>
<attribute name="name" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="_id" optional="YES" attributeType="Double" syncable="YES"/>
<attribute name="name" optional="YES" attributeType="String" syncable="YES"/>
</entity>
<entity name="SWGOrderManagedObject" representedClassName="SWGOrderManagedObject" syncable="YES">
<attribute name="_id" optional="YES" attributeType="Double" syncable="YES"/>
<attribute name="petId" optional="YES" attributeType="Double" syncable="YES"/>
<attribute name="quantity" optional="YES" attributeType="Integer 16" syncable="YES"/>
<attribute name="shipDate" optional="YES" attributeType="Date" syncable="YES"/>
<attribute name="status" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="complete" optional="YES" attributeType="Boolean" syncable="YES"/>
<attribute name="_id" optional="YES" attributeType="Double" syncable="YES"/>
<attribute name="petId" optional="YES" attributeType="Double" syncable="YES"/>
<attribute name="quantity" optional="YES" attributeType="Integer 16" syncable="YES"/>
<attribute name="shipDate" optional="YES" attributeType="Date" syncable="YES"/>
<attribute name="status" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="complete" optional="YES" attributeType="Boolean" syncable="YES"/>
</entity>
<entity name="SWGPetManagedObject" representedClassName="SWGPetManagedObject" syncable="YES">
<attribute name="_id" optional="YES" attributeType="Double" syncable="YES"/>
<relationship name="category" optional="YES" maxCount="1" deletionRule="Cascade" destinationEntity="SWGCategoryManagedObject" syncable="YES"/>
<attribute name="name" attributeType="String" syncable="YES"/>
<attribute name="photoUrls" attributeType="Transformable" syncable="YES"/>
<relationship name="tags" optional="YES" toMany="YES" deletionRule="Cascade" destinationEntity="SWGTagManagedObject" syncable="YES"/>
<attribute name="status" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="_id" optional="YES" attributeType="Double" syncable="YES"/>
<relationship name="category" optional="YES" maxCount="1" deletionRule="Cascade" destinationEntity="SWGCategoryManagedObject" syncable="YES"/>
<attribute name="name" attributeType="String" syncable="YES"/>
<attribute name="photoUrls" attributeType="Transformable" syncable="YES"/>
<relationship name="tags" optional="YES" toMany="YES" ordered="YES" deletionRule="Cascade" destinationEntity="SWGTagManagedObject" syncable="YES"/>
<attribute name="status" optional="YES" attributeType="String" syncable="YES"/>
</entity>
<entity name="SWGTagManagedObject" representedClassName="SWGTagManagedObject" syncable="YES">
<attribute name="_id" optional="YES" attributeType="Double" syncable="YES"/>
<attribute name="name" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="_id" optional="YES" attributeType="Double" syncable="YES"/>
<attribute name="name" optional="YES" attributeType="String" syncable="YES"/>
</entity>
<entity name="SWGUserManagedObject" representedClassName="SWGUserManagedObject" syncable="YES">
<attribute name="_id" optional="YES" attributeType="Double" syncable="YES"/>
<attribute name="username" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="firstName" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="lastName" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="email" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="password" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="phone" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="userStatus" optional="YES" attributeType="Integer 16" syncable="YES"/>
<attribute name="_id" optional="YES" attributeType="Double" syncable="YES"/>
<attribute name="username" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="firstName" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="lastName" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="email" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="password" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="phone" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="userStatus" optional="YES" attributeType="Integer 16" syncable="YES"/>
</entity>

</model>
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ NS_ASSUME_NONNULL_BEGIN

@property (nullable, nonatomic, retain) NSArray<NSString*>* photoUrls;

@property (nullable, nonatomic, retain) NSSet<SWGTagManagedObject*>* tags;
@property (nullable, nonatomic, retain) NSOrderedSet<SWGTagManagedObject*>* tags;
/* pet status in the store [optional]
*/
@property (nullable, nonatomic, retain) NSString* status;
Expand All @@ -51,8 +51,8 @@ NS_ASSUME_NONNULL_BEGIN
@interface SWGPetManagedObject (GeneratedAccessors)
- (void)addTagsObject:(SWGTagManagedObject *)value;
- (void)removeTagsObject:(SWGTagManagedObject *)value;
- (void)addTags:(NSSet<SWGTagManagedObject*> *)values;
- (void)removeTags:(NSSet<SWGTagManagedObject*> *)values;
- (void)addTags:(NSOrderedSet<SWGTagManagedObject*> *)values;
- (void)removeTags:(NSOrderedSet<SWGTagManagedObject*> *)values;

@end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ -(void)updateSWGPetManagedObject:(SWGPetManagedObject*)managedObject withSWGPet:
managedObject.name = [object.name copy];
managedObject.photoUrls = [object.photoUrls copy];
if(object.tags) {
NSMutableSet * convertedObjs = [NSMutableSet set];
NSMutableOrderedSet * convertedObjs = [NSMutableOrderedSet orderedSet];
for (id innerObject in object.tags) {
id convertedObj = [self.tagsBuilder SWGTagManagedObjectFromSWGTag:innerObject context:managedObject.managedObjectContext];
[convertedObjs addObject:convertedObj];
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/objc/default/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This ObjC package is automatically generated by the [Swagger Codegen](https://gi

- API version: 1.0.0
- Package version:
- Build date: 2016-08-23T10:56:26.470+02:00
- Build date: 2016-09-06T10:33:50.612+02:00
- Build package: class io.swagger.codegen.languages.ObjcClientCodegen

## Requirements
Expand Down