-
Notifications
You must be signed in to change notification settings - Fork 33
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
Generate additional delegating mappers for @InheritInverseConfiguration #88
Comments
I like the idea. If I'm not mistaken, we wouldn't even need a special annotation. Any method with |
If it works automatically without further configuration, that would be even better. As a stopgap solution, I'm currently using Spring magic to register @InheritInverseConfiguration-annotated methods in the Spring converter registry. But those methods aren't in the ConversionServiceAdapter, i.e. other Mappers cannot discover and use the inverse mappers. In short, solving this properly in maptruct would help here. |
Outline:
|
@pw-lehre I've done an implementation in this branch. While I'm still polishing some of the edges (including documentation), please feel free to have a go at it and check whether this looks like what you've got in mind. In the end, I went for requiring an additional annotation |
@Chessray Thanks a lot for the implementation, I did not expect that so many changes would be required for this. I'll try it out. |
Hi everyone,
I'd like to define multiple Spring Converter<S, T> implementations (with different generic parameters) in a single @Mapper annotated interface. However, due to type erasure, it is currently not possible to directly declare the same interface multiple times.
Would it be possible to generate additional implementation classes that delegate back to the additional Mapping methods? Currently, we need to manually define a delegate mapper.
Current approach:
It would be nice if additional Implementation classes could be generated with a simple annotation such as e.g.
@GenerateDelegate
.Idea for a future approach:
I'm asking this here since it would be especially useful together with the Spring Converter Interface, and would potentially also require an entry in the ConversionServiceAdapter.
The text was updated successfully, but these errors were encountered: