【问题标题】:Dozer Boolean mapping Eclipse error推土机布尔映射 Eclipse 错误
【发布时间】:2026-01-13 07:05:03
【问题描述】:

我正在使用Dozer 来映射对象。但我收到一条有线错误消息

com.edfx.adb.persist.entity.Customer 类的活动属性不能 从中读取。

在 Eclipse 的推土机映射编辑器中,我在 Eclipse 中安装了推土机插件。这是我的映射:

<mapping>
    <class-a>com.edfx.adb.persist.entity.Customer</class-a>
    <class-b>com.edfx.adb.web.dto.CustomerDTO</class-b>

    <field>
        <a get-method="isActive">active</a>
        <b get-method="isActive">active</b>
        <a-hint>java.lang.Boolean</a-hint>
        <b-hint>java.lang.Boolean</b-hint>
    </field>
</mapping>

这里的activeCustomerCustomerDTO 类中类型为boolean 的字段。

我无法删除或隐藏错误消息。也不知道为什么会显示。对于这个错误,Eclipse 会在整个项目中显示错误,这是不可取的。

任何信息都会对我很有帮助。

【问题讨论】:

    标签: java eclipse eclipse-plugin mapping dozer


    【解决方案1】:

    我会尝试删除提示。在这种情况下,我认为您不需要它们。 但为了获得最佳解决方案,您能否发布实体和 DTO 的代码。

    【讨论】: