Hi Ilya,
I’m using Java for BL.
Yes, our iOS developers use Backendless REST instead of SDK, and they told me that moving from REST to SDK would not be a good solution for them.
Also I’ve noticed that these fields appears instead of real objects also for single level of objects.
In next example:
Comment has link to Product
Product has link to Category
Category has link to itself.
I’m loading …/Comment?pageSize=1&loadRelations=products.categories
In response some Categories also presented as __originSubID instead of real objects although no circular references should be loaded in this case.
[spoiler=“response example”]{
“offset”: 0,
“data”: [
{
“authorEmail”: “sdgf”,
“created”: 1468478749000,
“someDate”: null,
“___class”: “Comment”,
“someStuff”: null,
“message”: “I’m in!”,
“ownerId”: null,
“category”: null,
“updated”: null,
“objectId”: “E8D708CB-2DA7-B96B-FFC5-6C745C9ABB00”,
“products”: [
{
“productId”: “asdfasdf”,
“created”: 1469435636000,
“deeplinkUrl”: “asdf”,
“description”: null,
“ownerId”: null,
“title”: null,
“pcck”: null,
“__meta”: “{“relationRemovalIds”:{},“selectedProperties”:[“highlight”,“productId”,“created”,“deeplinkUrl”,“description”,“categories”,“ownerId”,“title”,“updated”,“objectId”,“pcck”,“thumbnailUrl”],“relatedObjects”:{“categories”:[“29F9AF77-56C3-8F46-FFD8-B92101BFE300”,“75C2970D-2E76-67FA-FF46-D7124501EE00”,“9A588714-C2ED-6AB6-FF2C-842994E90000”,“B8E5D92A-6323-D845-FF06-5F355678A800”,“E5F2C6DA-3278-CA05-FF5B-6FE8EA341500”,“EE3E126F-2ED6-ACE2-FF58-F8D160943200”]}}”,
“highlight”: null,
“___class”: “Product”,
“categories”: [
{
“children”: [],
“created”: 1465215069000,
“name”: “Device parametrisation”,
“___class”: “Category”,
“ownerId”: null,
“__subID”: “B0C41059-59EF-7AFB-FF52-4B62423E5100”,
“updated”: null,
“objectId”: “29F9AF77-56C3-8F46-FFD8-B92101BFE300”,
“pcck”: “P-19-02”,
“__meta”: “{“relationRemovalIds”:{},“selectedProperties”:[”__updated__meta",“children”,“created”,“name”,"___class",“ownerId”,“updated”,“objectId”,“pcck”],“relatedObjects”:{}}"
},
{
“children”: [],
“created”: 1465214991000,
“name”: “Trusted Wireless 2.0 I/O”,
“___class”: “Category”,
“ownerId”: null,
“__subID”: “30062F91-FD4E-197B-FF26-D439167CD900”,
“updated”: null,
“objectId”: “75C2970D-2E76-67FA-FF46-D7124501EE00”,
“pcck”: “P-26-03-05”,
“__meta”: “{“relationRemovalIds”:{},“selectedProperties”:[”__updated__meta",“children”,“created”,“name”,"___class",“ownerId”,“updated”,“objectId”,“pcck”],“relatedObjects”:{}}"
},
{
“children”: [],
“created”: 1465215085000,
“name”: “Power supplies with max functionality”,
“___class”: “Category”,
“ownerId”: null,
“__subID”: “7D8405F8-A7E7-BFDB-FFD9-CEE8BAAC1A00”,
“updated”: null,
“objectId”: “9A588714-C2ED-6AB6-FF2C-842994E90000”,
“pcck”: “P-22-03-06”,
“__meta”: “{“relationRemovalIds”:{},“selectedProperties”:[”__updated__meta",“children”,“created”,“name”,"___class",“ownerId”,“updated”,“objectId”,“pcck”],“relatedObjects”:{}}"
},
{
“children”: [],
“created”: 1465215076000,
“name”: “DC charging cables”,
“___class”: “Category”,
“ownerId”: null,
“__subID”: “351C0466-C6DF-6718-FF06-F76E6CF55100”,
“updated”: null,
“objectId”: “B8E5D92A-6323-D845-FF06-5F355678A800”,
“pcck”: “P-10-06-01”,
“__meta”: “{“relationRemovalIds”:{},“selectedProperties”:[”__updated__meta",“children”,“created”,“name”,"___class",“ownerId”,“updated”,“objectId”,“pcck”],“relatedObjects”:{}}"
},
{
“children”: [],
“created”: 1465215089000,
“name”: “Conventional safety relays”,
“___class”: “Category”,
“ownerId”: null,
“__subID”: “E9A49E65-AD6F-237C-FFBF-F7A2ECB93700”,
“updated”: null,
“objectId”: “E5F2C6DA-3278-CA05-FF5B-6FE8EA341500”,
“pcck”: “P-05-01-01-03”,
“__meta”: “{“relationRemovalIds”:{},“selectedProperties”:[”__updated__meta",“children”,“created”,“name”,"___class",“ownerId”,“updated”,“objectId”,“pcck”],“relatedObjects”:{}}"
},
{
“children”: [],
“created”: 1465215020000,
“name”: “EtherNet/IP™”,
“___class”: “Category”,
“ownerId”: null,
“__subID”: “9DDBEDBD-16BA-5069-FFB6-944700694F00”,
“updated”: null,
“objectId”: “EE3E126F-2ED6-ACE2-FF58-F8D160943200”,
“pcck”: “P-04-07”,
“__meta”: “{“relationRemovalIds”:{},“selectedProperties”:[”__updated__meta",“children”,“created”,“name”,"___class",“ownerId”,“updated”,“objectId”,“pcck”],“relatedObjects”:{}}"
}
],
“updated”: null,
“objectId”: “31B75F7A-867A-82E5-FF3C-72F500BCC400”,
“thumbnailUrl”: null
},
{
“productId”: “fdghdfgh”,
“created”: 1471875324000,
“deeplinkUrl”: “sdfg”,
“description”: null,
“ownerId”: null,
“title”: null,
“pcck”: null,
“__meta”: “{“relationRemovalIds”:{},“selectedProperties”:[“highlight”,“productId”,“created”,“deeplinkUrl”,“description”,“categories”,“ownerId”,“title”,“updated”,“objectId”,“pcck”,“thumbnailUrl”],“relatedObjects”:{“categories”:[“29F9AF77-56C3-8F46-FFD8-B92101BFE300”,“75C2970D-2E76-67FA-FF46-D7124501EE00”,“9A588714-C2ED-6AB6-FF2C-842994E90000”,“B8E5D92A-6323-D845-FF06-5F355678A800”,“E5F2C6DA-3278-CA05-FF5B-6FE8EA341500”,“EE3E126F-2ED6-ACE2-FF58-F8D160943200”]}}”,
“highlight”: null,
“___class”: “Product”,
“categories”: [
{
“__originSubID”: “B0C41059-59EF-7AFB-FF52-4B62423E5100”
},
{
“__originSubID”: “30062F91-FD4E-197B-FF26-D439167CD900”
},
{
“__originSubID”: “7D8405F8-A7E7-BFDB-FFD9-CEE8BAAC1A00”
},
{
“__originSubID”: “351C0466-C6DF-6718-FF06-F76E6CF55100”
},
{
“__originSubID”: “E9A49E65-AD6F-237C-FFBF-F7A2ECB93700”
},
{
“__originSubID”: “9DDBEDBD-16BA-5069-FFB6-944700694F00”
}
],
“updated”: null,
“objectId”: “741BBD03-1B02-4AD3-FF90-3524F54F6000”,
“thumbnailUrl”: null
}
],
“__meta”: “{“relationRemovalIds”:{},“selectedProperties”:[“authorEmail”,“created”,“someDate”,”___class",“someStuff”,“message”,“ownerId”,“category”,“updated”,“objectId”,“products”],“relatedObjects”:{“products”:[“31B75F7A-867A-82E5-FF3C-72F500BCC400”,“741BBD03-1B02-4AD3-FF90-3524F54F6000”]}}"
}
],
“nextPage”: “https://api.backendless.com/v1/data/Comment?pageSize=1&offset=1&loadRelations=products.categories”,
“totalObjects”: 2
}
[/spoiler]
And when I’m removing from Category link to itself I’m getting perfect response with no __originSubID:
[spoiler=“response”]{
“offset”: 0,
“data”: [
{
“authorEmail”: “sdgf”,
“created”: 1468478749000,
“someDate”: null,
“___class”: “Comment”,
“someStuff”: null,
“message”: “I’m in!”,
“ownerId”: null,
“category”: null,
“updated”: null,
“objectId”: “E8D708CB-2DA7-B96B-FFC5-6C745C9ABB00”,
“products”: [
{
“productId”: “asdfasdf”,
“created”: 1469435636000,
“deeplinkUrl”: “asdf”,
“description”: null,
“ownerId”: null,
“title”: null,
“pcck”: null,
“__meta”: “{“relationRemovalIds”:{},“selectedProperties”:[“highlight”,“productId”,“created”,“deeplinkUrl”,“description”,“categories”,“ownerId”,“title”,“updated”,“objectId”,“pcck”,“thumbnailUrl”],“relatedObjects”:{“categories”:[“29F9AF77-56C3-8F46-FFD8-B92101BFE300”,“75C2970D-2E76-67FA-FF46-D7124501EE00”,“9A588714-C2ED-6AB6-FF2C-842994E90000”,“B8E5D92A-6323-D845-FF06-5F355678A800”,“E5F2C6DA-3278-CA05-FF5B-6FE8EA341500”,“EE3E126F-2ED6-ACE2-FF58-F8D160943200”]}}”,
“highlight”: null,
“___class”: “Product”,
“categories”: [
{
“created”: 1465215069000,
“name”: “Device parametrisation”,
“___class”: “Category”,
“ownerId”: null,
“__subID”: “BE206F8F-5167-EA33-FFB9-933D846BDF00”,
“updated”: null,
“objectId”: “29F9AF77-56C3-8F46-FFD8-B92101BFE300”,
“pcck”: “P-19-02”,
“__meta”: “{“relationRemovalIds”:{},“selectedProperties”:[”__updated__meta",“created”,“name”,"___class",“ownerId”,“updated”,“objectId”,“pcck”],“relatedObjects”:{}}"
},
{
“created”: 1465214991000,
“name”: “Trusted Wireless 2.0 I/O”,
“___class”: “Category”,
“ownerId”: null,
“__subID”: “D66F3737-A484-C57A-FFE5-DC4EEDD80A00”,
“updated”: null,
“objectId”: “75C2970D-2E76-67FA-FF46-D7124501EE00”,
“pcck”: “P-26-03-05”,
“__meta”: “{“relationRemovalIds”:{},“selectedProperties”:[”__updated__meta",“created”,“name”,"___class",“ownerId”,“updated”,“objectId”,“pcck”],“relatedObjects”:{}}"
},
{
“created”: 1465215085000,
“name”: “Power supplies with max functionality”,
“___class”: “Category”,
“ownerId”: null,
“__subID”: “75809FF0-9138-8E9A-FFA0-067C036A2C00”,
“updated”: null,
“objectId”: “9A588714-C2ED-6AB6-FF2C-842994E90000”,
“pcck”: “P-22-03-06”,
“__meta”: “{“relationRemovalIds”:{},“selectedProperties”:[”__updated__meta",“created”,“name”,"___class",“ownerId”,“updated”,“objectId”,“pcck”],“relatedObjects”:{}}"
},
{
“created”: 1465215076000,
“name”: “DC charging cables”,
“___class”: “Category”,
“ownerId”: null,
“__subID”: “F722D497-6E25-D65F-FFE8-11AE59112300”,
“updated”: null,
“objectId”: “B8E5D92A-6323-D845-FF06-5F355678A800”,
“pcck”: “P-10-06-01”,
“__meta”: “{“relationRemovalIds”:{},“selectedProperties”:[”__updated__meta",“created”,“name”,"___class",“ownerId”,“updated”,“objectId”,“pcck”],“relatedObjects”:{}}"
},
{
“created”: 1465215089000,
“name”: “Conventional safety relays”,
“___class”: “Category”,
“ownerId”: null,
“__subID”: “6A9C7DCA-3456-8991-FFA3-B14FC6147900”,
“updated”: null,
“objectId”: “E5F2C6DA-3278-CA05-FF5B-6FE8EA341500”,
“pcck”: “P-05-01-01-03”,
“__meta”: “{“relationRemovalIds”:{},“selectedProperties”:[”__updated__meta",“created”,“name”,"___class",“ownerId”,“updated”,“objectId”,“pcck”],“relatedObjects”:{}}"
},
{
“created”: 1465215020000,
“name”: “EtherNet/IP™”,
“___class”: “Category”,
“ownerId”: null,
“__subID”: “1009AE6E-022F-ED5E-FF02-EAE4E5B15900”,
“updated”: null,
“objectId”: “EE3E126F-2ED6-ACE2-FF58-F8D160943200”,
“pcck”: “P-04-07”,
“__meta”: “{“relationRemovalIds”:{},“selectedProperties”:[”__updated__meta",“created”,“name”,"___class",“ownerId”,“updated”,“objectId”,“pcck”],“relatedObjects”:{}}"
}
],
“updated”: null,
“objectId”: “31B75F7A-867A-82E5-FF3C-72F500BCC400”,
“thumbnailUrl”: null
},
{
“productId”: “fdghdfgh”,
“created”: 1471875324000,
“deeplinkUrl”: “sdfg”,
“description”: null,
“ownerId”: null,
“title”: null,
“pcck”: null,
“__meta”: “{“relationRemovalIds”:{},“selectedProperties”:[“highlight”,“productId”,“created”,“deeplinkUrl”,“description”,“categories”,“ownerId”,“title”,“updated”,“objectId”,“pcck”,“thumbnailUrl”],“relatedObjects”:{“categories”:[“29F9AF77-56C3-8F46-FFD8-B92101BFE300”,“75C2970D-2E76-67FA-FF46-D7124501EE00”,“9A588714-C2ED-6AB6-FF2C-842994E90000”,“B8E5D92A-6323-D845-FF06-5F355678A800”,“E5F2C6DA-3278-CA05-FF5B-6FE8EA341500”,“EE3E126F-2ED6-ACE2-FF58-F8D160943200”]}}”,
“highlight”: null,
“___class”: “Product”,
“categories”: [
{
“created”: 1465215069000,
“name”: “Device parametrisation”,
“___class”: “Category”,
“ownerId”: null,
“__subID”: “BE206F8F-5167-EA33-FFB9-933D846BDF00”,
“updated”: null,
“objectId”: “29F9AF77-56C3-8F46-FFD8-B92101BFE300”,
“pcck”: “P-19-02”,
“__meta”: “{“relationRemovalIds”:{},“selectedProperties”:[”__updated__meta",“created”,“name”,"___class",“ownerId”,“updated”,“objectId”,“pcck”],“relatedObjects”:{}}"
},
{
“created”: 1465214991000,
“name”: “Trusted Wireless 2.0 I/O”,
“___class”: “Category”,
“ownerId”: null,
“__subID”: “D66F3737-A484-C57A-FFE5-DC4EEDD80A00”,
“updated”: null,
“objectId”: “75C2970D-2E76-67FA-FF46-D7124501EE00”,
“pcck”: “P-26-03-05”,
“__meta”: “{“relationRemovalIds”:{},“selectedProperties”:[”__updated__meta",“created”,“name”,"___class",“ownerId”,“updated”,“objectId”,“pcck”],“relatedObjects”:{}}"
},
{
“created”: 1465215085000,
“name”: “Power supplies with max functionality”,
“___class”: “Category”,
“ownerId”: null,
“__subID”: “75809FF0-9138-8E9A-FFA0-067C036A2C00”,
“updated”: null,
“objectId”: “9A588714-C2ED-6AB6-FF2C-842994E90000”,
“pcck”: “P-22-03-06”,
“__meta”: “{“relationRemovalIds”:{},“selectedProperties”:[”__updated__meta",“created”,“name”,"___class",“ownerId”,“updated”,“objectId”,“pcck”],“relatedObjects”:{}}"
},
{
“created”: 1465215076000,
“name”: “DC charging cables”,
“___class”: “Category”,
“ownerId”: null,
“__subID”: “F722D497-6E25-D65F-FFE8-11AE59112300”,
“updated”: null,
“objectId”: “B8E5D92A-6323-D845-FF06-5F355678A800”,
“pcck”: “P-10-06-01”,
“__meta”: “{“relationRemovalIds”:{},“selectedProperties”:[”__updated__meta",“created”,“name”,"___class",“ownerId”,“updated”,“objectId”,“pcck”],“relatedObjects”:{}}"
},
{
“created”: 1465215089000,
“name”: “Conventional safety relays”,
“___class”: “Category”,
“ownerId”: null,
“__subID”: “6A9C7DCA-3456-8991-FFA3-B14FC6147900”,
“updated”: null,
“objectId”: “E5F2C6DA-3278-CA05-FF5B-6FE8EA341500”,
“pcck”: “P-05-01-01-03”,
“__meta”: “{“relationRemovalIds”:{},“selectedProperties”:[”__updated__meta",“created”,“name”,"___class",“ownerId”,“updated”,“objectId”,“pcck”],“relatedObjects”:{}}"
},
{
“created”: 1465215020000,
“name”: “EtherNet/IP™”,
“___class”: “Category”,
“ownerId”: null,
“__subID”: “1009AE6E-022F-ED5E-FF02-EAE4E5B15900”,
“updated”: null,
“objectId”: “EE3E126F-2ED6-ACE2-FF58-F8D160943200”,
“pcck”: “P-04-07”,
“__meta”: “{“relationRemovalIds”:{},“selectedProperties”:[”__updated__meta",“created”,“name”,"___class",“ownerId”,“updated”,“objectId”,“pcck”],“relatedObjects”:{}}"
}
],
“updated”: null,
“objectId”: “741BBD03-1B02-4AD3-FF90-3524F54F6000”,
“thumbnailUrl”: null
}
],
“__meta”: “{“relationRemovalIds”:{},“selectedProperties”:[“authorEmail”,“created”,“someDate”,”___class",“someStuff”,“message”,“ownerId”,“category”,“updated”,“objectId”,“products”],“relatedObjects”:{“products”:[“31B75F7A-867A-82E5-FF3C-72F500BCC400”,“741BBD03-1B02-4AD3-FF90-3524F54F6000”]}}"
}
],
“nextPage”: “https://api.backendless.com/v1/data/Comment?pageSize=1&offset=1&loadRelations=products.categories”,
“totalObjects”: 2
}
[/spoiler]
So the only way to deal with it without using sdk is to process it by hands?
Best Regards, Oleg