-
Notifications
You must be signed in to change notification settings - Fork 41
MappingType lost in recursive mapping #56
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Hi @petromir, this is a bug that i'm going to fix, for now you can proceed? or you're stuck? |
I'm currently blocked, but I will be happy if you suggest any temporary workaround. |
you can change the setNestedDestinationText method? in the case of it: public void setNestedDestinationText (String nestedDestinationText){
if(nestedDestinationText != null)
this.nestedDestinationText = nestedDestinationText;
} |
However this is a recursive mapping, for nested mapping i mean when you need to map a field with another field in different level, an example of nested mapping using your code is: public class Source {
@JMap("{nestedDestination.nestedDestinationText}")
private String sourceText;
private NestedSource nestedSource;
// Getters, Setters and toString()
} for recursive mapping the problem should not exist, I will try to fix as soon as possible |
ok @petromir! issue fixed! download the project and run: |
Thanks! |
I have the following case:
And the output is the following:
As you can see
nestedDestinationText
's value has been deleted even ifMappingType.ONLY_VALUED_FIELDS
is selected. Not that this happens only in nested objects, so if you leavesourceText
asnull
and populatedestinationText
with some value, then the value will be presented, e.g.The text was updated successfully, but these errors were encountered: