Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If your JSON has the relationships by referencing the identity attribute instead of by nesting JSONs, you can take advantage of the
identityAttributeRelated
attribute. For example, if your JSONNSDictionary
is:you may not want Groot to serialize this dictionary by setting 1 to the
Publisher
relationship, but by assigning it with thePublisher
object which has 1 as itsidentityAttribute
value. You accomplish that by associating the identityAttribute key withtrue
(or any other positive boolean value) in the entity user info dictionary:This way, Groot will search in the publisher entity for a entry with the given identity attribute. If it is found, it will assign this entry as the
Publisher
object of theCharacter
; if it doesn't Groot will create a placeholderPublisher
entry with this value for the identity attribute. This placeholder object would be filled eventually if the new data is provided.Note: To make this feature works, you must always to use the merge methods instead of the insert ones.