-
-
Notifications
You must be signed in to change notification settings - Fork 941
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
Nested Mappings suddenly stop with return null #3575
Comments
Running into problem that I'm not able to get it reproduceable within the mapstruct code-base IT's. Think I'll go debug the workings of mapstruct in the private codebase to figure out why it goes wrong, and then use this knowledge to create a reproduction scenario. |
After some more analysis, the cause was a Closing this issue as invalid, but we might need to discuss how we want |
@Zegveld I am facing a similar issue on 1.6.0.Beta1 where the deeply nested object fields are not being mapped. Possible to reopen this issue? SituationMapping(source = "a.b.c.d1", target = "name") Expected Behaviour
Actual Behaviour
As a result, the target object is being created but with its fields not populated. |
@alantanlc Could you please provide a reproducible example? I tried to create one with your snippet, but wasn't able to reproduce this. A simple code that runs in a single java file would be nice, like this (which is not working right now): @Mapper
interface Issue3575Mapper {
@Mapping(source = "a.b.c.d1", target = "name")
D2 aToD2(A a);
}
class A {
public B b;
}
class B {
public C c;
}
class C {
public D1 d1;
}
class D1 {
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
class D2 {
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
} This currently fails with |
Not reopening this issue, see #3577 for the discussion about behaviour of ignoreByDefault combined with (nested) mappings. |
Situation description
I'm using mapstruct to handle conversions from an older version of a datastructure to a newer version.
Example of changes that happen for me:
Old data structure:
New data structure:
Expected behavior
Now I've defined a single mapping tree to handle all the movements:
Expected is that mapstruct continues with mapping of the code. In 1.5.5 this was also the case.
Actual behavior
This results in the following code being generated:
Steps to reproduce the problem
To be added once reproduced in mapstruct code base itself.
MapStruct Version
Mapstruct 1.6.0.Beta1
The text was updated successfully, but these errors were encountered: