Dozer : String-To-Date Field Level Mapping for a List

时光总嘲笑我的痴心妄想 提交于 2019-12-04 21:05:13

As,Dozer is not able to convert String-To-Date - At Field Level Mapping for a List.

I had defined a new mapping for the List i.e., considering it as a Object

I Changed the DozerMapper.xml

<?xml version="1.0" encoding="UTF-8"?>
<mappings xmlns="http://dozer.sourceforge.net" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://dozer.sourceforge.net http://dozer.sourceforge.net/schema/beanmapping.xsd">

<mapping date-format="MM/dd/yyyy HH:mm" map-null="true" map-empty-string="true" wildcard="true" type="one-way" >
        <class-a>com.college.student.dto.FeeReceiptDTO</class-a>
        <class-b>com.college.student.vo.FeeReceiptVO</class-b>
</mapping>

    <mapping date-format="MM/dd/yyyy HH:mm" map-null="true" map-empty-string="true" wildcard="true" type="one-way" >
        <class-a>com.college.student.dto.StudentDTO</class-a>
        <class-b>com.college.student.vo.StudentVO</class-b>
        <field>
            <a>student.sid</a>
            <b>sid</b>
        </field>
        <field>
            <a>student.name</a>
            <b>name</b>
        </field>
        <field>
            <a>student.createDt</a>
            <b>createDt</b>
        </field>
        <field>
            <a>student.studentInd</a>
            <b>studentInd</b>
        </field>
        <field>
            <a>student.feeDetails</a>
            <b>feeDetails</b>
        </field>

    </mapping>
</mappings>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!