首页 > 解决方案 > Selma 使用 IgnoreNullValue 字段类型从 Dto 更新实体的问题 Date

问题描述

我正在使用 Selma 将我的对象从 Dto 映射到实体,包括从 Dto 更新实体,当我将 (withIgnoreNullValue = true) 添加到我的映射器时,我不知道他为什么不忽略字段类型日期的空值。当我检查我的生成类映射器时,我发现了这个

if (inDto.getStartDate() != null) {
        out.setStartDate(new java.util.Date(inDto.getStartDate().getTime()));
      }
      else {
        out.setStartDate(null);
      } 

标签: javaspring-bootmapper

解决方案


推荐阅读