Copy POJO content from one bean to another

后端 未结 7 1331
臣服心动
臣服心动 2020-11-30 13:50

I have few Pojos in different packages, each POJO contains set of the another pojo from the same package. I need to copy all items with the same name from Package B Pojos to

7条回答
  •  清歌不尽
    2020-11-30 14:30

    If you already have spring dependencies you could use org.springframework.beans.BeanUtils

    BeanUtils.copyProperties(from, to);
    

提交回复
热议问题