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
[Question] Map nested objects with single mapper #51
Comments
Hi @petromir, |
Great, waiting for the test. |
I created the test using your classes and configurations but the test does not return errors, sure there is not anything else? however, below the test code: JMapper<Destination, Source> mapper = new JMapper<>(Destination.class, Source.class);
NestedSource nestedSource = new NestedSource("nestedSourceData");
Source source = new Source();
source.setSourceText("sourceText");
source.setNestedSource(nestedSource);
Destination destination = mapper.getDestination(source);
assertEquals("sourceText", destination.getDestinationText());
assertEquals("nestedSourceData", destination.getNestedDestination().getNestedDestinationData()); |
Sorry, my mistake. It works as expected! Thanks |
@petromir classes attribute isn't mandatory, you could reduce configuration |
@avurro Yeah I know but I want to limit it to specific class, if this is the way to do it 😄 |
it's the right way 👍 |
I have the following case:
The example above doesn't work due to:
I would like to map the nested object automatically using single mapper like:
without the need to create one for each nested object like:
The text was updated successfully, but these errors were encountered: