Exclude null value issues in dozer hint

281 views
Skip to first unread message

gaurav jain

unread,
Mar 27, 2019, 5:17:53 AM3/27/19
to Dozer Mapper
I am  mapping the inherited class of source class to another inherited classes of destination using hint in dozer mapping file .But i am getting the null values as well during the mapping.I want to exlcude the  properties having the null values . I have used map-null="false" map-empty-string="false" at class level as well as mapping level but nothing is getting impacted.Kindly look in to it asap.

<?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 map-null="false" map-empty-string="false" wildcard="false">
<class-a m ><source class></class-a>
<class-b map-null="false" map-empty-string="false" ><destination class></class-b>
<field>
<a><source base property> </a>
<b><destination base property></b>
<a-hint>
<source child class 1 extending super class of source base property>,
                <source child class 2 extending super class of source base property>,
                :
                :
                <source child class n extending super class of source base property>,

</a-hint>
<b-hint>
< destination child class 1 extending super class of destination base property>,
                < destination child class 2 extending super class of destination base property>,
                :
                :
                < destination child class n extending super class of destination base property>,

</b-hint>
</field>

</mapping>
</mappings>


I have some fields in the destination subclasses which are set as null.I want to exclude the properties having null values.

Thanks
Reply all
Reply to author
Forward
0 new messages