-
Notifications
You must be signed in to change notification settings - Fork 0
06) helloSpringDataJpa
choi jae ho edited this page Jun 2, 2021
·
13 revisions
- id๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ํด์ ์กฐํํ๊ธฐ ๋ณด๋ค๋, ๊ฒ์์ ํตํด์ ์กฐํํ ๊ฒฝ์ฐ๊ฐ ์๋ค.
- ๊ทธ ๋ถ๋ถ์ ๋ํด์๋ ์ถ๊ฐ์ ์ผ๋ก ๊ตฌํํด์ผ ํ๋ค.
- Spring Data JPA ๋ CRUD operations๋ฅผ ์ ๊ณตํ๋ค.
- method names์ ๋ฐ๋ผ ๋์ ์ผ๋ก ์ฟผ๋ฆฌ๋ฅผ ์ ๊ณตํ๋ค.
ex)
- User findByEmail(String email), ์ด๋ฉ์ผ์ ๊ธฐ์ค์ผ๋ก ์กฐํํ๋ ๋ฉ์๋ ๋ด๋ถ์ ์ผ๋ก SQL ์๋์ ์ผ๋ก ๋ง๋ค์ด์ง๋ค. ์ด๋ฆ์ ๋ฐํ์ผ๋ก ๋ฉ์๋๋ฅผ ์๋์ผ๋ก ๋ง๋ค์ด์ค๋ค๋์ .
- User findByEmailAndPassword(String email, String password) ๋ ๋ง์ฐฌ๊ฐ์ง๋ก ๋ง๋ค์ด์ค๋ค.