{"action":"created","issue":{"url":"https://api.github.com/repos/EasyMapping/EasyMapping/issues/103","labels_url":"https://api.github.com/repos/EasyMapping/EasyMapping/issues/103/labels{/name}","comments_url":"https://api.github.com/repos/EasyMapping/EasyMapping/issues/103/comments","events_url":"https://api.github.com/repos/EasyMapping/EasyMapping/issues/103/events","html_url":"https://github.com/EasyMapping/EasyMapping/issues/103","id":92109394,"number":103,"title":"Multiple objects with same value of primary key field.","user":{"login":"AlloyDev","id":1926920,"avatar_url":"https://avatars.githubusercontent.com/u/1926920?v=3","gravatar_id":"","url":"https://api.github.com/users/AlloyDev","html_url":"https://github.com/AlloyDev","followers_url":"https://api.github.com/users/AlloyDev/followers","following_url":"https://api.github.com/users/AlloyDev/following{/other_user}","gists_url":"https://api.github.com/users/AlloyDev/gists{/gist_id}","starred_url":"https://api.github.com/users/AlloyDev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlloyDev/subscriptions","organizations_url":"https://api.github.com/users/AlloyDev/orgs","repos_url":"https://api.github.com/users/AlloyDev/repos","events_url":"https://api.github.com/users/AlloyDev/events{/privacy}","received_events_url":"https://api.github.com/users/AlloyDev/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"DenHeadless","id":853604,"avatar_url":"https://avatars.githubusercontent.com/u/853604?v=3","gravatar_id":"","url":"https://api.github.com/users/DenHeadless","html_url":"https://github.com/DenHeadless","followers_url":"https://api.github.com/users/DenHeadless/followers","following_url":"https://api.github.com/users/DenHeadless/following{/other_user}","gists_url":"https://api.github.com/users/DenHeadless/gists{/gist_id}","starred_url":"https://api.github.com/users/DenHeadless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DenHeadless/subscriptions","organizations_url":"https://api.github.com/users/DenHeadless/orgs","repos_url":"https://api.github.com/users/DenHeadless/repos","events_url":"https://api.github.com/users/DenHeadless/events{/privacy}","received_events_url":"https://api.github.com/users/DenHeadless/received_events","type":"User","site_admin":false},"milestone":null,"comments":12,"created_at":"2015-06-30T14:28:40Z","updated_at":"2015-07-05T13:31:56Z","closed_at":"2015-07-05T13:31:56Z","body":"I've got object with children of the same class. I wrote mapping and set primary keys.\r\nHere is my mapping: https://gist.github.com/AlloyDev/c59a0e40dbd0fd0e9c52\r\nI map objects with `+ (NSArray *)arrayOfObjectsFromExternalRepresentation:(NSArray *)externalRepresentation\r\n                                          withMapping:(EKManagedObjectMapping *)mapping\r\n                               inManagedObjectContext:(NSManagedObjectContext*)context` method. \r\n\r\nFor some reason I received objects with same `clusterId` field."},"comment":{"url":"https://api.github.com/repos/EasyMapping/EasyMapping/issues/comments/118619865","html_url":"https://github.com/EasyMapping/EasyMapping/issues/103#issuecomment-118619865","issue_url":"https://api.github.com/repos/EasyMapping/EasyMapping/issues/103","id":118619865,"user":{"login":"DenHeadless","id":853604,"avatar_url":"https://avatars.githubusercontent.com/u/853604?v=3","gravatar_id":"","url":"https://api.github.com/users/DenHeadless","html_url":"https://github.com/DenHeadless","followers_url":"https://api.github.com/users/DenHeadless/followers","following_url":"https://api.github.com/users/DenHeadless/following{/other_user}","gists_url":"https://api.github.com/users/DenHeadless/gists{/gist_id}","starred_url":"https://api.github.com/users/DenHeadless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DenHeadless/subscriptions","organizations_url":"https://api.github.com/users/DenHeadless/orgs","repos_url":"https://api.github.com/users/DenHeadless/repos","events_url":"https://api.github.com/users/DenHeadless/events{/privacy}","received_events_url":"https://api.github.com/users/DenHeadless/received_events","type":"User","site_admin":false},"created_at":"2015-07-05T13:31:56Z","updated_at":"2015-07-05T13:31:56Z","body":"Thanks you for taking time and making detailed example and tests.\r\n\r\nI have spent some time researching this stuff, but it seems you have duplicated clusterID's once again in your JSON - http://d.pr/i/qaXf\r\n\r\nIt's not clear how EasyMapping would even deal with these kinds of JSON. Even if we were caching objects before their full initialization, behavior would still be incorrect - you would be replacing parent object content with the child one.\r\n\r\nIt seems you are having issue with your back-end, not with EasyMapping. You probably should not get duplicated clusterID on children objects in the way you are receiving.\r\n\r\nI'm closing this issue for now, cause it seems EasyMapping if behaving correctly( or at least reasonable, given this kind of JSON). \r\n\r\nFeel free to reopen this issue or create a new one, if there is duplication in different scenarios."}}