Dozer and Spring integration

左心房为你撑大大i 提交于 2019-12-03 07:41:15

Both are valid approaches, just inject this mapper as a dependency in the service class responsible for mapping, eg:

@Service
public class MyMappingService{
 @Autowired DozerBeanMapper dozerBeanMapper;
}

With DozerBeanMapperFactoryBean the approach along these lines should work:

<bean class="org.dozer.spring.DozerBeanMapperFactoryBean">
....
</bean>

This returns a mapper instance, so just inject in a mapper type this way:

@Service
public class MyMappingService{
 @Autowired Mapper dozerBeanMapper;
}
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!