Copy POJO content from one bean to another

后端 未结 7 1314
臣服心动
臣服心动 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:22

    Well.. Dozer may be just the thing you're looking for.

    . . . its an object to object mapping framework. The idea is that:

    • Usually it will map by convention.
    • You can override this convention with a mapping file.

    . . therefore mapping files are as compact as possible. Its useful for many cases, such as mapping a use-case specify service payload on to the reusable core model objects.

    When delivering the SpringSource training courses we used to point out this framework very often.

提交回复
热议问题