Skip to content

Latest commit

ย 

History

History
54 lines (40 loc) ยท 1.49 KB

JPA-Console.md

File metadata and controls

54 lines (40 loc) ยท 1.49 KB
title catalog subtitle header-img tags
์ธํ…”๋ฆฌ์ œ์ด JPA Console
true
JPA Console
IntelliJ
JPA
JPA Console

JPA๋ฅผ ์‹œ์ž‘ํ•˜๋ฉด์„œ ํฌ๊ฒŒ ๋ถˆํŽธํ–ˆ๋˜ ์ ์ด ์ฟผ๋ฆฌ ์‹คํ–‰ ๊ฒฐ๊ณผ๋ฅผ ๋ฐ”๋กœ๋ฐ”๋กœ ํ™•์ธํ•  ์ˆ˜ ์—†๋Š” ์ ์ด์—ˆ๋Š”๋ฐ IntelliJ JPA Console ๊ธฐ๋Šฅ์œผ๋กœ ํ™•์ธํ•ด๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

DataBase ์—ฐ๋™

Data Source

  • ์‚ฌ์šฉ ์ค‘์ธ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

Database ์ •๋ณด ์ž…๋ ฅ

  • Name, Host, Database, User, Password๋ฅผ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.

JPA ์—ฐ๋™

JPA Module ์ถ”๊ฐ€

  1. Project Structure ์„ค์ •
  2. Modules ํƒญ์ด๋™
  3. ์ƒ๋‹จ + ํด๋ฆญ ์ดํ›„ JPA ์ถ”๊ฐ€
  4. ํ•˜๋‹จ + ํด๋ฆญ ์ดํ›„ Hibernate ์ถ”๊ฐ€

Persistence ์ถ”๊ฐ€

  1. ์œ„์˜ ์ž‘์—…์„ ์™„๋ฃŒํ–ˆ์œผ๋ฉด ์™ผ์ชฝ ํƒญ์— Persistence ์ถ”๊ฐ€๋ฉ๋‹ˆ๋‹ค.
  2. Assign Data Sourcesโ€ฆ.๋ฅผ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.
  3. Assign Data Sources ์—์„œ Data Source ํ•ญ๋ชฉ์— ์œ„์— ์ถ”๊ฐ€ํ•ด Data Source ํ•ญ๋ชฉ์„ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.

JPA Console

JPA Console ์—ฐ๊ฒฐ

  1. entityManagerFactory๋ฅผ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.
  2. Console๋ฅผ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.
  3. JPA Console๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

Query

JPQL ์ฟผ๋ฆฌ๋ฅผ ํ†ตํ•ด์„œ ๊ฒฐ๊ณผ๋ฅผ ์ถœ๋ ฅํ–ˆ์Šต๋‹ˆ๋‹ค. ๋‹ค์Œ ํฌ์ŠคํŒ…์—๋Š” ๊ตฌ์ฒด์ ์ธ ์‚ฌ์šฉ๋ฒ•์„ ์ง„ํ–‰ํ•ด ๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค