Search
Duplicate
โ˜•

์‚ญ์ œ vs ์ˆ˜์ •

Role ๋„๋ฉ”์ธ์—์„œ Role Name ์„ ๋ณ€๊ฒฝํ•  ๋•Œ!
Role ์—๋Š” RoleNames ๋ผ๋Š” ์ผ๊ธ‰ ์ปฌ๋ ‰์…˜์ด ์žˆ๊ณ , RoleNames ์—๋Š” List<RoleName> ์ด๋ผ๋Š” ๋ฉค๋ฒ„ ๋ณ€์ˆ˜๊ฐ€ ์žˆ๋‹ค.
์šฐ๋ฆฌ๋Š” Role Name ์„ ๋ณ€๊ฒฝํ•  ๋•Œ RoleName ์„ ์ˆ˜์ •ํ•˜์ง€ ์•Š๊ณ  ์ƒˆ๋กœ RoleNames ๊ฐ์ฒด๋ฅผ ๋งŒ๋“ค์–ด ๋ฐ”๊ฟ”์ค€๋‹ค.
this.roleNames = RoleNames.from(names);
Java
๋ณต์‚ฌ
โ†’ ์ด๋ ‡๊ฒŒ ๋œ๋‹ค๋ฉด JPA ๋Š” ์ˆ˜์ •์„ ํ• ๊นŒ, ์‚ญ์ œ๋ฅผ ํ• ๊นŒ?
๊ฒฐ๋ก ์ ์œผ๋กœ ์‚ญ์ œ๋ฅผ ํ•œ ๋’ค, insert ๋ฅผ ํ•œ๋‹ค.
์•„๋งˆ RoleNames ๊ฐ์ฒด๊ฐ€ ๋™์ผ์„ฑ์—์„œ ๋ฐ”๋€Œ์–ด ๋ฒ„๋ ธ์œผ๋‹ˆ, ์‚ญ์ œ๋ฅผ ํ•˜๊ณ  ๋‹ค์‹œ insert ํ•˜๋Š” ๋“ฏํ•˜๋‹ค. ์ •ํ™•ํ•˜๊ฒŒ๋Š” ์ฐพ์•„๋ด์•ผ ํ• ๋“ฏ.