-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recursive relationship to same object #81
Comments
So we would need to set primary key and cache before fill object which would look something like this:
|
Hello, @jcavar! Thanks for your issue! It looks like that FEM can handle this easily. Anyway primary key mapping has some specific rules and thus can be extracted from the object fulfilling method. I'll fix it later today if it works for you :) |
Well that was fast response 👍. Sure it works :) |
I'll roll out update with fix later this morning (third of April) |
Nice, thank you :) |
Hi,
We have the following JSON structure:
We are using CoreData and we encountered problem when transforming this. Chat with identifier 1 is created twice. I think we identified why is this happening:
So the issue is in
FEMDeserializer.m
- (id)_objectFromRepresentation:(NSDictionary *)representation mapping:(FEMMapping *)mapping allocateIfNeeded:(BOOL)allocate
.If object is not in cache, it is inserted and then filled from external representation. When filling it, inner chat is encountered and not found in cache and inserted as well. So we end up with 2 same chats.
The issue could be solved by caching object before calling fillObject.
I hope this makes sense? Is this something that FastEasyMapping should handle?
The text was updated successfully, but these errors were encountered: