Search
Duplicate
โ˜•

projection

entity projection

โ€ข
์˜์†์„ฑ์— ๊ด€๋ฆฌ๊ฐ€ ๋จ

embedded type projection

โ€ข
select m.address from member m; ํ•˜๋ฉด address ์˜ ๊ฐ’ ํƒ€์ž…์— ํ•ด๋‹นํ•˜๋Š” ์ปฌ๋Ÿผ๋งŒ ์กฐํšŒํ•œ๋‹ค.
โ—ฆ
select m.country, m.city, m.zipcode from member m;

scala projection

โ€ข
`select m.name, m.age from member m;
โ—ฆ
Query โ†’ List ๋กœ ๋ฐ˜ํ™˜, 0๋ฒˆ์งธ ๊ฐ’์— Object[] ๋กœ ์บ์ŠคํŒ… ํ›„ ๊ฐ€์ ธ์˜ฌ ์ˆ˜ ์žˆ์Œ
โ—ฆ
Object[] TypedQuery โ†’ ์บ์ŠคํŒ…๊นŒ์ง€๋งŒ ํ•ด์คŒ
โ—ฆ
DTO Query โ†’ select com.example.DTO(m.name, m.age) from member m; ์œผ๋กœ ์กฐํšŒ ๊ฐ€๋Šฅ