Dozer, how to ignore a field with annotation

大憨熊 提交于 2019-12-10 15:07:04

问题


I'm using dozer to map objects. How can I ignore (exclude) a field using annotations with dozer?

Something like:

    class A
    { 
       @IgnoreField
       public String someField;
    }

    class B
    { 
       public String someField;
    }

    .........................................
    B obj = mapper.map(A_obj, B.class);

Thanks a lot!!


回答1:


Use @Mapping("this"). It will help you



来源:https://stackoverflow.com/questions/40117348/dozer-how-to-ignore-a-field-with-annotation

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