using QualifiedName in place of Expression

37 views
Skip to first unread message

joyce mazumder

unread,
Nov 7, 2020, 11:52:44 PM11/7/20
to mapstruct-users
Hi
I have a ProductUtil class which contains getProductType(ProductRequest request) method.
ProductRequest   objecct contains ProducctObject and there is no overloading.

  • In mapper class I m using it like this way 
@mapping(expression = "java( productUtil . getProductType( request))" target ="producctType" ).

Can this also be used useing qualifiedby Name like this way . is qqualified Byname a repalccement of expression.

  • @mapping(source ="product" target = "productType", qualifiedbyName = "getProductType") 

In util class by tweaking the input parameter
@Named
getProductType(Product product)   


Plz suggest
Reply all
Reply to author
Forward
0 new messages