• Source
    1. @Mapper(componentModel = "spring")
    2. public interface ProductMapper {
    3.  
    4. ProductMapper INSTANCE = Mappers.getMapper(ProductMapper.class);
    5.  
    6.  
    7. @Mappings({@Mapping(source = "price", target = "productPrice", qualifiedByName = "priceToProductPrice"),
    8. @Mapping(source="id", target="productId")
    9. })
    10. public abstract ProductOutput mapProductEntity2Output(ProductEntity productEntity);
    11.  
    12. @Named("priceToProductPrice")
    13. public static String priceToProductPrice(BigDecimal price) {
    14. return price.toString()+" ?";
    15. }
    16.  
    17. }