Java bean mapping to wrapper bean example 2017-02-06 01:44

We need to convert java beans to another java bean when pass it from one layer to another. For example, you need to convert PO(persistent object) to BO(business object) when pass it from DAO layers to business layers. I recommend you to use Dozer instead of converting them by yourself.

The content of pom is like following.


The code of convert java bean to wrapper bean is like following.

public class DozerTest {
    public static void main(String[] args) {
        DozerBeanMapper dozer = new DozerBeanMapper();
        User user = new User();
        UserWrapper userWrapper =, UserWrapper.class);