[์ดํํฐ๋ธ ์๋ฐ] Item26 ์๋ฒฝ๊ณต๋ต. GenericRepository
item26. ๋ก ํ์
์ ์ฌ์ฉํ์ง ๋ง๋ผ. Generic Dao ๋ง๋ค๊ธฐ Generic์ ํ์ฉํ๋ฉด ์ค๋ณต ์ฝ๋๋ฅผ ์ ๊ฑฐํ ์ ์๋ค๋ ์ฅ์ ์ ๋ณด์ฌ์ฃผ๊ธฐ ์ํด์ ๊ฐ์์๊ฐ์ ๊ฐ๋จํ Repository๋ฅผ ๋ง๋ค์๋ค. public interface Entity { Long getId(); } public class Account implements Entity { private Long id; private String username; public Account(Long id, String username) { this.id = id; this.username = username; } @Override public Long getId() { return this.id; } public String getUsername()..
2023.03.15