【发布时间】:2020-06-30 11:46:25
【问题描述】:
在将 mapstruct 从 1.2.0 升级到 1.3.1 后,我注意到注释 @Mapper(nullValueCheckStrategy=NullValueCheckStrategy.ALWAYS) 无效。
它是新 mapstruct 版本的错误吗?
例子:
以下代码:
String id = getTestId( testId);
if ( id != null ) {
testCase.setTestCaseId( id );
}
else {
testCase.setTestCaseId( null );
}
而右边是:
String id = getTestId( testId);
if ( id != null ) {
testCase.setTestCaseId( id );
}
【问题讨论】:
-
您的映射方法看起来如何?这是更新映射吗?
-
我在这里找到了解决方案:github.com/mapstruct/mapstruct/issues/1790