클래스간에 프로퍼티 복사
set으로 하나씩 하나씩 하기에는 귀찮음

스프링에서 제공하는 API 사용 하자

BeanUtils.copyProperties(source, target);
source : 원본 객체
target :  복사 대상 객체

BeanUtils.copyProperties(source, target, String ... ignoreProperites);
source : 원본 객체
target : 복사 대상 객체
ignoreProperities : 복사를 원하지 않는 프로퍼티명





반응형

+ Recent posts