In the two-day project, because the attributes of pojo are too large, I thought of using the beanutils method copyproperties of Apache to help copy the attribute values. So I first wrote a test class.
Regardless of the result, all the copied results are null, and the result of painstaking thinking is not good. The data is searched everywhere on the Internet. Obviously, the method of copying is the same, but the result is unsatisfactory. It is always null...
Finally, I thought about it carefully. The problem may be on bean. The only difference between the demo made by myself and the demo made on the Internet is that all of them are public classes, and my class is default class .....
So we put the two beans in the test classCodeCopied out, and two other public classes are written... Finally... Come out. Now I know that the original Apache property replication method only works for public classes .... But in fact, this is not a serious problem. We would have declared all form and pojo in public... Haha