-
-
Notifications
You must be signed in to change notification settings - Fork 916
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
Generic type use , An error was obtained --- Can't generate mapping method for a generic type variable source. #2954
Comments
The problem is that mapstruct will attempt to map the Perhaps the checking for generics can become less strict, when the fields affected by the generics are already explicitly specified. In your case it is most likely that inside |
|
@Zegveld You are right, The |
It is currently not supported, but this is a nice enhancement to be added. |
I'll look forward to it.thinks |
…rget with direct assignment.
please do not close this issue, as it will be used to track this. |
got |
…n using multiple parameters.
hi, @Zegveld
Such conversion is still impossible? Or will both of these situations become possible |
@xg578962913 a generic conversion such as If you are interested in something like that then you could implement it in your own way by implementing a custom processor that is going to create an implementation that works for something like this. |
@filiphr Thanks, I got it |
@filiphr I have another use case which should be supported: @Mapper
abstract class ServiceRequestMapper {
@Mapping(target = ".", source = "request")
fun <Request: IdlData<Request>> toRequest(serviceRequest: ServiceRequest<Request>) : Request = serviceRequest.request
} The |
@thedrow this looks like Kotlin code. How does the java code for this example look like? |
background
I want to mapping entity to VO for PageInfo,The code :
When compile, an error was obtained ------ Can't generate mapping method for a generic type variable source.
environment
Jdk : 11
Mapstruct:1.5.0.RC1
I didn't get answer on the Internet
Please help me. Thanks
The text was updated successfully, but these errors were encountered: