2021-05-26(Wed)

Facts (์‚ฌ์‹ค, ๊ฐ๊ด€)

  • ์ง€์›ํ•œ ํšŒ์‚ฌ์˜ 1์ฐจ ๋ฉด์ ‘์„ ๋ณด์•˜๋‹ค. ๋ถ€์กฑํ–ˆ๋˜ ๋ถ€๋ถ„์˜ ํ‚ค์›Œ๋“œ๋ฅผ ์ •๋ฆฌํ•ด๋’€๋‹ค.

  • ์ฝ”๋“œ์ˆจ 4์ฃผ์ฐจ ๊ณผ์ œ๋ฅผ ๊ตฌํ˜„ํ•˜์˜€๋‹ค.

    • Spring JPA Data๊ฐ€ ์ธํ„ฐํŽ˜์ด์Šค๋งŒ ์„ ์–ธํ–ˆ๋Š”๋ฐ ์ž‘๋™ํ•˜๋Š” ๊ฒƒ์ด ์ž˜ ์ดํ•ด๊ฐ€ ์•ˆ ๋˜์–ด์„œ ๊ด€๋ จํ•ด์„œ ์ข€ ๋” ํ•™์Šตํ–ˆ๋‹ค.

    • ์ฝ”๋“œ์ˆจ 4์ฃผ์ฐจ ๊ณผ์ œ๋ฅผ ๊ตฌํ˜„ํ•  ๋•Œ ํ…Œ์ŠคํŠธ๋ฅผ ๋จผ์ € ์ž‘์„ฑํ•˜๊ณ  ์ง„ํ–‰ํ•˜๋ ค๊ณ  ํ–ˆ๋Š”๋ฐ ์‹คํŒจํ–ˆ๋‹ค.

Feelings (๋Š๋‚Œ, ์ฃผ๊ด€)

๋‚˜ ํ˜ผ์ž ๋“ค์–ด๊ฐ„ ์ฒซ ๊ธฐ์ˆ ๋ฉด์ ‘.. ์•„.. ๋จธ๋ฆฌ๊ฐ€ ํ•˜์–˜์ง„๋‹ค๋Š” ๊ฒƒ์ด ์–ด๋–ค ๋œป์ธ์ง€ ์‹ค๊ฐํ–ˆ๋‹ค. ์„ค๊ณ„ํ–ˆ๋˜ 15๊ฐœ ํ…Œ์ด๋ธ”์„ ๋˜‘๋ฐ”๋กœ ๊ทธ๋ฆฌ์ง€ ๋ชป ํ–ˆ๋‹ค. ์ง„์งœ ์ด๋ถˆํ‚ฅ ๊ฐ์ด ๋‚˜์˜ค๊ณ  ๋ง์•˜๋‹ค. 3๊ฐœ์›” ์ „์— ๋งŒ๋“ค์—ˆ๋˜ ํ”„๋กœ์ ํŠธ๋ผ ๊ธฐ์–ต์—์„œ ํœ˜๋ฐœ๋œ ๊ฒƒ๋„ ์žˆ๊ณ , ๊ทธ ๋งŒํผ ์ฒดํ™”๊ฐ€ ๋œ ๋˜์—ˆ๋‹ค๋Š” ๊ฒƒ๋„ ์›์ธ์ด๋‹ค. ์‚ฌ์‹ค ์ด๋ ฅ์„œ์— ์ ์—ˆ์œผ๋ฉด ์ด๊ฑธ ์ข€ ๋” ์ œ๋Œ€๋กœ ์ค€๋น„ํ–ˆ์–ด์•ผ ํ–ˆ๋Š”๋ฐ ์•„์‰ฝ๋‹ค. ๋ถ€์กฑํ–ˆ๋˜ ๋ถ€๋ถ„์„ ์ ์–ด๋†“๊ณ , ์ฐจ์ฐจ ์ฑ„์›Œ์•ผ๊ฒ ๋‹ค.

๋ฉด์ ‘ ์งˆ๋ฌธ ์ค‘ ์žฌ๋ฐŒ๋Š” ํ™”๋‘๊ฐ€ ์žˆ์—ˆ๋Š”๋ฐ, ํ…Œ์ŠคํŠธ ์ผ€์ด์Šค๋ฅผ ๋งŒ๋“ค ๋•Œ ๋ฌด์กฐ๊ฑด ๋™์ž‘ํ•ด์•ผํ•˜๋Š” ๊ฒƒ์ด ์ž˜ ๋™์ž‘ํ•˜๋Š”์ง€๋ฅผ ๊ฒ€์ฆํ•˜๋Š” ์šฉ๋„์™€ ์ ˆ๋Œ€ ๋™์ž‘ํ•˜๋ฉด ์•ˆ ๋˜๋Š” ๊ฒƒ์„ ๊ฒ€์ฆํ•˜๋Š” ์šฉ๋„ ์ค‘์— ์–ด๋–ค ์šฉ๋„๋กœ ํ…Œ์ŠคํŠธ ์ผ€์ด์Šค๋ฅผ ๋” ์ง‘์ค‘ํ•ด์„œ ๋งŒ๋“ค์ง€์— ๋Œ€ํ•œ ๊ฒƒ ์ด์—ˆ๋‹ค. ํ  ๋‚˜๋Š” ์ „์ž๋ฅผ ํƒํ–ˆ๋Š”๋ฐ, ๋‹น์—ฐํžˆ ๋ ๊ฑฐ๋ผ๊ณ  ๋ฏฟ๊ณ  ์žˆ๋Š” ๋ถ€๋ถ„์ด ์ž˜๋ชป ๋™์ž‘ํ•  ๋•Œ์˜ ์œ„ํ—˜์ด ๊ฐ€์žฅ ํฌ๋‹ค๊ณ  ์ƒ๊ฐํ–ˆ๊ธฐ ๋•Œ๋ฌธ์ด๋‹ค. ์ด๋Ÿฐ ์ˆ˜๋‹ค๊ฐ€ ์žฌ๋ฐŒ๋Š”๊ฑฐ ๊ฐ™๋‹คใ…Žใ…Ž

์ฝ”๋“œ์ˆจ 4์ฃผ์ฐจ ๊ณผ์ œ์˜ ๊ฒฝ์šฐ, ์ด๋ฏธ ๊ตฌํ˜„๋˜์–ด ์žˆ๋Š” ํ…Œ์ŠคํŠธ์— ์˜์กดํ•ด์„œ ์ฝ”๋“œ๋ฅผ ๊ตฌํ˜„ํ•œ ๊ฒƒ์ด ์•„์‰ฝ๋‹ค. Test first! ํ•˜๊ณ  ์‹ถ์—ˆ๋Š”๋ฐ..

Findings (๋ฐฐ์šด ์ )

JPA interface ๊ตฌํ˜„ ์—ฌ๋ถ€์— ๋Œ€ํ•ด์„œ

In a typical Java application, you might expect to write a class that implements CustomerRepository. However, that is what makes Spring Data JPA so powerful: You need not write an implementation of the repository interface. Spring Data JPA creates an implementation when you run the application. - spring-guide accessing data with JPA

๊ตฌํ˜„ํ•  ํ•„์š”๊ฐ€ ์—†๋‹ค. Spring Data JPA๊ฐ€ '์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์ด ์‹คํ–‰๋  ๋•Œ' ์ž๋™์œผ๋กœ ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ๊ตฌํ˜„ํ•ด์ค€๋‹ค. ํ˜ผ๋ž€์ด ์‹น ๊ฐ€์…จ๋‹ค.

Affimation (์ž๊ธฐ ์„ ์–ธ)

๋‚˜๋Š” ๋ชฐ๋ž๋˜ ๋ถ€๋ถ„์„ ์ธ์ง€ํ•˜๊ณ , ์ ๊ทน์ ์œผ๋กœ ์ฑ„์›Œ๋‚ด๋Š” ๊ฐœ๋ฐœ์ž๋‹ค.

Last updated