ModelMapper, mapping list of Entites to List of DTO objects

前端 未结 5 1210
深忆病人
深忆病人 2021-02-01 23:49

I am writing simple blog web application using Spring MVC framework. I am willing to add DTO layer to my app.

I decided to use ModelMapper framework for con

5条回答
  •  旧巷少年郎
    2021-02-02 00:14

    Try the following simple way:

    List postDtoList = Arrays.asList(modelMapper.map(postEntityList, PostDTO[].class));
    

提交回复
热议问题