ModelMapper, mapping list of Entites to List of DTO objects

前端 未结 5 1195
深忆病人
深忆病人 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:17

    since you want to convert Entity to Dto, you can try the following one

    List entityToDto = modelMapper.map(postEntity, new TypeToken>(){}.getType());
    

提交回复
热议问题