jmapper-core icon indicating copy to clipboard operation
jmapper-core copied to clipboard

Nested mapping in source and destination

Open sanket-jayasval opened this issue 6 years ago • 0 comments

Hi,

I am new to JMapper, was trying to map two nested objects.

Scenario:

Source {                                    Destination {
    User {                                              Address {
         Address {                                                String city;
               String city;                                      }
         }                                             }
    }
   String city2;
}

Working Fine :


JMapperAPI jmapperApi = new JMapperAPI()
                .add(mappedClass(Source.class)
        .add(attribute("city2").value("${address.city}"))

Not working:


JMapperAPI jmapperApi = new JMapperAPI()
                .add(mappedClass(Source.class)
        .add(attribute("${user.address.city}").value("${address.city}"))

Could you please help , what's wrong here ?

sanket-jayasval avatar Sep 19 '19 19:09 sanket-jayasval