Dozer, how to ignore a field with annotation

2019-06-21 04:28发布

问题:

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