http://modelmapper.org/

  • 객체의 프로퍼티를 다른 객체의 프로퍼티로 맵핑해주는 유틸리티

 

의존성 추가

<dependency>
    <groupId>org.modelmapper</groupId>
    <artifactId>modelmapper</artifactId>
    <!-- <version>2.3.6</version> -->
    <!-- 라이브러리 다운로드가 불가하여 2.4.2 버전사용 -->
    <version>2.4.2</version>
</dependency>​

Tokenizers 설정을 하지 않았을때 생기는 modelMapper에러

 

토크나이저 설정

modelMapper.getConfiguration()
  .setSourceNameTokenizer(NameTokenizers.UNDERSCORE)
  .setDestinationNameTokenizer(NameTokenizers.UNDERSCORE)
 

 

실습

 

30. 알림 설정 · devjun63/whiteship-studyolle@5dfd08c

Permalink This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. Browse files 30. 알림 설정 Loading branch information Showing 5 changed files with 143 additions and 4 deletions. +11 −0 src/m

github.com

 

31. ModelMapper 적용 · devjun63/whiteship-studyolle@b111536

Permalink This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. Browse files 31. ModelMapper 적용 Loading branch information Showing 6 changed files with 36 additions and 38 deletions. +5 −0 p

github.com