Closed cloudlessa closed 3 months ago
下个版本会在 AutoMapper
中增加 nullValuePropertyMappingStrategy
,就可以针对单个类进行配置了,已经加好了,正在测试阶段。
strategy这个加不了,因为 MapStruct 的原理是在编译阶段生成转换代码,所以执行的时候,转换逻辑是固定的,不能配置。
下个版本 AutoMapper
中nullValuePropertyMappingStrategy
是可以针对source或者target都可以进行配置的吧?期待早点上线。
下个版本
AutoMapper
中nullValuePropertyMappingStrategy
是可以针对source或者target都可以进行配置的吧?期待早点上线。
可以的,支持在 AutoMapping
上面配置,这次把 MapStruct 注解中所有支持的配置都加上了,所以需要测试的有点多,我尽快
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
1.AutoMapping注解 表字段很多不方便,也不想全局修改 2.MapperConfig注解 配置自定义的NullValuePropertyMappingStrategy nullValuePropertyMappingStrategy() default NullValuePropertyMappingStrategy.IGNORE; 这个也不太方便,不想全局修改。只是特殊情况下会使用到这个source的属性为空的时候,保留target的原来的属性 目前只找到这两个方法,还有其他更好的方法吗?
能提供一个类似的方法convert(source, target, strategy) strategy类,自定义转换过程中的配置。 或者其他方法也行。