mapstruct-plus icon indicating copy to clipboard operation
mapstruct-plus copied to clipboard

MapStruct Plus is an enhancement to the MapStruct framework. It can automatically generate the transformation operation between two classes through an annotation, omitting the operation of defining th...

Results 12 mapstruct-plus issues
Sort by recently updated
recently updated
newest added

我下载了ruoyi-flex源码,其中用到了mapstruct-plus, 项目结构如下: .pom.xml ./ruoyi-admin 项目中引用了"./ruoyi-modules/ruoyi-demo" 项目中使用了mapstruct-plus ./ruoyi-modules ./ruoyi-modules/ruoyi-demo 项目中使用了mapstruct-plus 项目在vscode中,无法正常编译,会在./ruoyi-admin和./ruoyi-modules/ruoyi-demo中的generated-sources目录重复生成java文件。 这样java编译会报Java类重复定义的错误。

M1模块依赖于M2模块, 想要生成 M2模块中的A转换为M1模块中的B1 以及 M2模块中的A转换为M2模块中的B2。 config: ``` @MapperConfig(adapterClassName = "M1ConvertMapperAdapter", mapperPackage = "com.m1.model.mapper", adapterPackage = "io.github.linpeilie.adapter", mapAdapterClassName = "M1MapConvertMapperAdapter") ``` ``` @MapperConfig(adapterClassName = "M2ConvertMapperAdapter", mapperPackage = "com.m2.model.mapper", adapterPackage = "io.github.linpeilie.adapter",...

stale

![image](https://github.com/linpeilie/mapstruct-plus/assets/90759163/c11b8c45-bf02-4f6f-aa42-c1404ff4c24f) ![1712990300295](https://github.com/linpeilie/mapstruct-plus/assets/90759163/a5a93aa4-88a0-4b4a-93b2-f5103e418cd4) 但是生成的代码报错,如下 ![image](https://github.com/linpeilie/mapstruct-plus/assets/90759163/e57cf96e-0d44-442f-8d75-e870d5b037c3) 但是我用set编译器就不会报错

enhancement
stale

版本:1.4.0 本地运行没有问题,上线就出现这种情况 异常日志: java.lang.NullPointerException: Cannot invoke "io.github.linpeilie.ConverterMapperAdapter.coace_BaseOrderItemToBaseOrderItemVO(java.util.List)" because "this.converterMapperAdapter" is null at com.ohuo.application.common.entity.BaseOrderToOrderVOMapperImpl.convert(BaseOrderToOrderVOMapperImpl.java:39) at com.ohuo.application.common.entity.BaseOrderToOrderVOMapperImpl.convert(BaseOrderToOrderVOMapperImpl.java:11) at io.github.linpeilie.Converter.convert(Converter.java:28) at com.ohuo.application.order.OrderApplicationService.createOrder(OrderApplicationService.java:121) at com.ohuo.application.order.OrderApplicationService.createSeatOrder(OrderApplicationService.java:163) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:351) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196) at...

配置实体类如下 ![PixPin_2024-04-29_14-00-43](https://github.com/linpeilie/mapstruct-plus/assets/18366406/6cbac220-e4b8-4c4d-aca9-f035b3eb496f) ![PixPin_2024-04-29_14-01-02](https://github.com/linpeilie/mapstruct-plus/assets/18366406/d1c4606e-5c40-4da4-a03a-c9956cfd33d7) 然后在1.3.5的表现正常,1.4.0时出现了错误,帮帮孩子😭 - 1.3.5 ![PixPin_2024-04-29_13-46-11](https://github.com/linpeilie/mapstruct-plus/assets/18366406/ff95790b-abb6-4771-a556-03e788a83793) - 1.4.0 ![PixPin_2024-04-29_14-00-20](https://github.com/linpeilie/mapstruct-plus/assets/18366406/40234131-5300-421a-bd2d-3effb2cd71e4)

bug

1.AutoMapping注解 表字段很多不方便,也不想全局修改 2.MapperConfig注解 配置自定义的NullValuePropertyMappingStrategy nullValuePropertyMappingStrategy() default NullValuePropertyMappingStrategy.IGNORE; 这个也不太方便,不想全局修改。只是特殊情况下会使用到这个source的属性为空的时候,保留target的原来的属性 目前只找到这两个方法,还有其他更好的方法吗? 能提供一个类似的方法convert(source, target, strategy) strategy类,自定义转换过程中的配置。 或者其他方法也行。

``` @Data @Schema(description = "个人路由VO") @AutoMapper(target = Resource.class, uses = RouteVO.class, convertGenerate = false) public class RouteVO { @Schema(description = "键值") private String key; @Schema(description = "名称") private String name;...

出现如下报错信息 ``` [ERROR] Couldn't find type io.github.linpeilie.mapstruct.SpringContextUtils. Are you missing a dependency on your classpath? [ERROR] Couldn't find type io.github.linpeilie.mapstruct.SpringContextUtils. Are you missing a dependency on your classpath? [ERROR] Couldn't...

stale

代码抽到子模块jar包里面 就会 报io.github.linpeilie.ConvertException: cannot find converter from SysPost to SysPostVo at io.github.linpeilie.Converter.convert(Converter.java:31) at io.github.linpeilie.Converter.lambda$convert$0(Converter.java:54) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682) at io.github.linpeilie.Converter.convert(Converter.java:54)...

stale

![image](https://github.com/user-attachments/assets/c4eff438-4f61-4be8-b040-5d5902f0c8ac) ![image](https://github.com/user-attachments/assets/3c710465-7d98-4f46-aab2-3eb4ce6df7b4) ![image](https://github.com/user-attachments/assets/20bcdea7-6246-4e16-a9d3-559612065576) ![image](https://github.com/user-attachments/assets/0627f6b7-3df5-422b-adbc-da9210f21fbc) 跨模块使用枚举映射会有问题