Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有两节课:
public class Source { String a; } public class Target { String a, b; }
当我从源映射到目标时,属性a被完美映射。但是源中不存在的属性b始终设置为 null。有没有办法避免这种行为?
实例化新对象时,所有属性都设置为 null。Orika 将仅设置已使用的属性,其他属性将保留其空值。