简体   繁体   中英

Orika - How to disable Mapping for unused Attributes?

I have two classes:

public class Source {
    String a;
}

public class Target {
    String a, b;
}

When I map from source to target the attribute a is perfectly mapped. But the attribut b , which is not existing in the source, is always set to null. Is there a way to avoid this bahaviour?

When new object is instantiated all attributes are set to null. Orika will set only used attributes the others will keep their null value.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM