๋ฐ์ํ ๊ฐ์ฒด ๋ณต์ฌ1 [Spring] ๊ฐ์ฒด๋ณต์ฌ BeanUtils.copyProperties() & ์๋ ์๋ฆฌ • ์๋ ํ์ธ์~ ์ด์ ์ ์ด์ํ๋ ๋ธ๋ก๊ทธ ๋ฐ GitHub, ๊ณต๋ถ ๋ด์ฉ์ ์ ๋ฆฌํ๋ Study-GitHub ๊ฐ ์์ต๋๋ค! • ๋ค์ด๋ฒ ๋ธ๋ก๊ทธ • GitHub • Study-GitHub • ๐ โ BeanUtils.copyProperties() ์๋ ํ์ธ์, ์ด๋ฒ์ ์ ๋ฆฌํ ๋ด์ฉ์ Spring์ BeanUtils ํด๋์ค์ copyProperties ๋ฉ์๋ ์ ๋๋ค. ์ต๊ทผ ์คํ๋ง์ ๊ณต๋ถํ๋ฉฐ Entity์ Dto ์ฌ์ด์์ ๊ฐ์ ๋ณต์ฌํ ๋ ์ด ๋ฉ์๋๋ฅผ ์ฌ์ฉํ๋๊ฑธ ๋ดค์๋๋ฐ์, ๋ฐ๋ผ์ ์ ๋ฆฌํด๋ณด๊ณ ์ ์์ฑํ๊ฒ ๋์์ต๋๋ค. public UserDto(User source) { copyProperties(source, this); this.profileImageUrl = source.getProfileImageUrl().orElse(n.. 2021. 2. 20. ์ด์ 1 ๋ค์ ๋ฐ์ํ