-
Notifications
You must be signed in to change notification settings - Fork 38
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
Custom looping mapper #189
Comments
Hi, |
Sorry, I don't have the compilation anymore, I had to find a hot fix. Problem sims to come from collection of objects I can't map with a different mapper for the nested objects than the main one I'm working on. |
Hi, thanks for your reply, the withCustom will use the specified custom mapper for all shop to shop mapping inside asShopDto(...) and its sons. So using withCustomFields is definitely the good solution, but there can be a bug on it. What was the hotfix you found ? There can be an issue with the withCustomFields while working on collections this probably was the source of the error. |
Hie Slemesle,
I didn't found out how to make such kind of things:
@Mapper(ignoreMissingProperties = true,
withIgnoreNullValue = true,
withIoC = IoC.SPRING,
withCyclicMapping = true
)
public interface ShopFullMapper {
@maps(withCustom = {
ShopLightMapper.class
})
ShopDto asShopDto(Shop in);
}
My problem is that a shop contains a link to another shop or another collection of shops and I would like to use a different mapper for the nested objects instead of the origin one. Is it possible inside an object mapper to use a different mapper for the same kind of object ?
If I specify withCustom the FullMapper is ignored and the ShopLightMapper is used instead for all objects. And using withCustomFields is not able to compile, did I forget something or a completely different configuration for that kind of loop mapping ?
Thank you for your help.
The text was updated successfully, but these errors were encountered: