Does dozer support list to list mapping?

Goods.java

@Getter
@Setter
public class Goods {
    private Integer id;

    private String url;

    private Integer groupId;

    private Integer sourceId;

    private Integer userId;

    private Date createTime;

    private Date updateTime;

}

GoodsVo.java

@Getter
@Setter
public class GoodsVo {

    private Integer id;

    private String url;

    private Integer groupId;

    private Integer sourceId;

    private Integer userId;
}
List<Goods> goods = goodsService.listGoodsByGroup(groupId);

I want to change List < Goods > to List < GoodsVo > . How can I change it? Thank you!


you have to do a simple package yourself to achieve


public class DozerUtils {

    /**
     * dozer:List<S> --> List<T>
     */
    public static <T, S> List<T> mapList(final Mapper mapper, List<S> sourceList, Class<T> targetObjectClass) {
        List<T> targetList = new ArrayList<T>();
        for (S s : sourceList) {
            targetList.add(mapper.map(s, targetObjectClass));
        }
        return targetList;
    }
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3470a-2b279.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3470a-2b279.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?