1.使用的jar:org.springframework.cglib.beans.BeanCopier
2.final BeanCopier copier = BeanCopier.create(source.class, target.class, false);
copier.copy(file, response, null);
2:这样就完成了两个类之间的拷贝。
3.注意点:
1.只有属性名和类型一致才能拷贝。
2.Integer和int之间也不能拷贝。
1.使用的jar:org.springframework.cglib.beans.BeanCopier
2.final BeanCopier copier = BeanCopier.create(source.class, target.class, false);
copier.copy(file, response, null);
2:这样就完成了两个类之间的拷贝。
3.注意点:
1.只有属性名和类型一致才能拷贝。
2.Integer和int之间也不能拷贝。