Menu

Copy one list to another

albel
2011-01-13
2013-05-02
  • albel

    albel - 2011-01-13

    I spend couple of hours trying to figure out how to copy List<Office> to List<IdNameBean> without wrapping object.

    void myMethod(List<Office> list1, List<IdNameBean> list2) {
    mapper.map(list1,list2);
    }

    Should I write some custom mapper or there is easer way to do this?

     
  • dmitry (lv)

    dmitry (lv) - 2011-01-13

    There are certain problems in Dozer when you try to work with Arrays or Collections directly. Somehow the framework was originally built to work with plain objects as the source and destination. So we could call that a bug. It is on the list, but quite a complex issue.

    Dmitry

     

Log in to post a comment.

MongoDB Logo MongoDB