/**
* @description
* <pre>
* source 중 target과 항목명이 같은 데이터를 복사.
* </pre>
* @param source 원본 data
* @param target 타겟 data
*/
public static void copyData(Object source, Object target) {
try {
BeanUtils.copyProperties(source, target);
} catch (BeansException be) {
logger.debug(be.getMessage(), be);
} catch (Exception e) {
logger.debug(e.getMessage(), e);
}
}
사용예)
SrcVo src = svc.getData(param);
TrgtVo trgt = new TrgtVo();
ErpUtils.copyData(src, trgt);관련글 : 서로 다른 유형의 List 복사
