Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

多个对象转同一个对象 #15

Closed
enjoymore opened this issue Oct 9, 2018 · 1 comment
Closed

多个对象转同一个对象 #15

enjoymore opened this issue Oct 9, 2018 · 1 comment

Comments

@enjoymore
Copy link

假设 有AVO,BVO 都可能转CInfo,Cinfo内部有个字段D是枚举需要打CopyProperty注解,但是AVO有这个字段,BVO没有这个字段,能不能 转换的时候没有对应的属性,就直接转换结果为Null不要直接抛异常

@yangtu222
Copy link
Owner

Hi, 建议使用Option Class方式来用。
ToBean toBean = BeanCopyUtils.copyBean(fromBean, ToBean.class, ToBeanOption.class);
在ToBeanOption中将不需要转换的属性使用CopyProperty标记成ignore即可。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants