how can i map dtos using mapstruct?

no need to implement toDtos method for this. This code should be enough and Mapstruct will handle the rest alone.

@Mapper(componentModel = "spring")
public interface BoardListMapper extends EntityMapper<BoardListDto, Board> {
    @Override
    @Mapping(target = "userName", source = "user.name")
    BoardListDto toDto(Board board);

}

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top