#31 allow override to exclude mapping of \"\" src field value

closed
5
2006-02-02
2006-01-28
No

allow override to exclude mapping of empty string src
field value.
Currently a "" src field value will always result in
the dest field value being "". Prior to mapping, if
the dest field is already populated or a default value
is specified for the dest field, the dest field will
contain "" after mapping if the src field is "".
In most cases it seems reasonable that this is the
correct behavior. But in some cases, it would be
desreable to Not map the "" value to the dest
field. This was requested by Scott Lemke. I see the
impl being....

<mapping map-empty-string="false">
<class-
a>net.sf.dozer.util.mapping.vo.AnotherTestObject</class
-a>
<class-
b>net.sf.dozer.util.mapping.vo.AnotherTestObjectPrime</
class-b>
<field>
<a>field1</a>
<b>someOtherField</b>
</field>
</mapping>

Or....

<mapping>
<class-a map-empty-
string="false">net.sf.dozer.util.mapping.vo.AnotherTest
Object</class-a>
<class-
b>net.sf.dozer.util.mapping.vo.AnotherTestObjectPrime</
class-b>
<field>
<a>field1</a>
<b>someOtherField</b>
</field>
</mapping>

Or.....

<mapping>
<class-
a>net.sf.dozer.util.mapping.vo.AnotherTestObject</class
-a>
<class-
b>net.sf.dozer.util.mapping.vo.AnotherTestObjectPrime</
class-b>
<field>
<a map-empty-string="false">field1</a>
<b>someOtherField</b>
</field>
</mapping>

Discussion

  • Matt Tierney

    Matt Tierney - 2006-01-29
    • status: open --> pending
     
  • Matt Tierney

    Matt Tierney - 2006-01-29

    Logged In: YES
    user_id=1236069

    This feature has been implemented and will be in the next
    release.

     
  • Franz Garsombke

    Franz Garsombke - 2006-02-02
    • summary: allow override to exclude mapping of "" src field value --> allow override to exclude mapping of \"\" src field value
    • status: pending --> closed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks