Posts
Q&A
@ManyToMany์ ๊ด๋ จ๋ ์ง๋ฌธ์ ๋๋ค.
๊ฐ์ฌํฉ๋๋ค! ํด๊ฒฐํ์ต๋๋ค. ํด๋์ค์ ์ฒด์ @Builder๋ฅผ ์ ์ฉํ์ง์๊ณ ์ํฐํฐ์ ๋ฐ๋ก ์์ฑ์๋ฅผ ๋ง๋ค์ด @ManyToMany์ฒ๋ผ ์ฐ๊ด๊ด๊ณ๋ฅผ ์ ์ธํ ๋ถ๋ถ๋ง ๋น๋ ํจํด์ผ๋ก ๋ฐ์์ ์๊ฒ ํ์ต๋๋ค.
- 1
- 4
- 413
Q&A
@ManyToMany์ ๊ด๋ จ๋ ์ง๋ฌธ์ ๋๋ค.
๋ง์ต๋๋ค. Setter๋ฅผ ์ฐ์ง ์๊ธฐ์ํด์ ๋น๋๋ฅผ ์จ์ ๋ง๋ค์๋๋ฐ ๊ทธ๋ ๋ค๋ฉด Setter๋ฅผ ์ฌ์ฉํ์ฌ modelMapper๋ฅผ ์ด์ฉํด ๋ฐ์ธ๋ฉํด์ ๋ง๋๋ ๋ฐฉ๋ฒ๋ฐ์ ์๋๊ฑด๊ฐ์? @PostMapping("/new-society")public String newSocietySubmit(@CurrentAccount Account account, @Valid SocietyForm societyForm, Errors errors, Model model) { if (errors.hasErrors()) { model.addAttribute("account", account); return "society/form"; } Society newSociety = Society.builder() .path(societyForm.getPath()) .title(societyForm.getTitle()) .shortDescription(societyForm.getShortDescription()) .fullDescription(societyForm.getFullDescription()) .build(); Society society = societyService.createNewSociety(newSociety, account); return "redirect:/society/" + society.getEncodedPath();}
- 1
- 4
- 413
Q&A
์๋์ฐ ๋๋ ํ ๋ฆฌ, ํจํค์ง, ํด๋์ค ๋ฑ ์์ฑ ๋ชฉ๋ก ๋ณด๊ธฐ ๋จ์ถํค ๊ด๋ จ์ง๋ฌธ์ด์
์ ํด๊ฒฐ ํ์ต๋๋ค! Fnํค๋ฅผ ์ด์ฉํด์ delete๋ฅผ insert๋ก ๋ณํํด์ ๊ฒฐ๊ตญ์ Fn+Alt+delete(insert)ํค ์กฐํฉ์ผ๋ก ๋จ๋ค์ ๊ฐ์ฌํฉ๋๋ค~!!
- 0
- 2
- 289