<dependency> <groupId>ma.glasnost.orika</groupId> <artifactId>orika-core</artifactId> <version>1.5.4</version> </dependency>
@Configuration public class OrikaConfig { @Bean public MapperFactory mapperFactory() { return new DefaultMapperFactory.Builder().build(); } @Bean public MapperFacade mapperFacade(MapperFactory mapperFactory) { return mapperFactory.getMapperFacade(); } }
Ex:
mapperFactory.classMap(PersonSource.class, PersonDestination.class)
.field("firstName", "givenName")
.field("lastName", "sirName")
.byDefault()
.register();