jmapper-framework / jmapper-core

Elegance, high performance and robustness all in one java bean mapper
http://jmapper-framework.github.io/jmapper-core
Apache License 2.0
231 stars 41 forks source link

Nested mapping in source and destination #87

Open sanket-jayasval opened 5 years ago

sanket-jayasval commented 5 years ago

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 ?