๋ฐ˜์‘ํ˜•
[Querydsl] ๊ธฐ๋ณธ ๋ฌธ๋ฒ• - QType, ์กฐ๊ฑด์ ˆ, ๊ฒฐ๊ณผ ๋งคํ•‘

๋ชจ๋“  ์†Œ์Šค ์ฝ”๋“œ๋Š” ์—ฌ๊ธฐ ์žˆ์Šต๋‹ˆ๋‹ค. Querydsl์˜ ๊ธฐ๋ณธ ๋ฌธ๋ฒ•์„ ์†Œ๊ฐœํ•ฉ๋‹ˆ๋‹ค. Q Type ์ด์ „ ํฌ์ŠคํŒ…์—์„œ ์‚ฌ์šฉํ•œ Entity๋“ค์„ compileQuerydsl์„ ์ด์šฉํ•ด ๋ชจ๋‘ Q Type์œผ๋กœ ๋ณ€ํ™˜ํ•˜์˜€์Šต๋‹ˆ๋‹ค. (์ž์„ธํ•œ ๋‚ด์šฉ์€ ์ด์ „ ํฌ์ŠคํŒ… ์ฐธ๊ณ ) Q Type ๊ฐ์ฒด๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์€ ์ด์ „ ํฌ์ŠคํŒ…์—์„œ๋„ ์†Œ๊ฐœํ–ˆ์ง€๋งŒ ๋‘ ๊ฐ€์ง€๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. QPlayer player = new QPlayer("p"); // (1) QPlayer player = Qplayer.player; // (2) (1) alias๋ฅผ ๋ณ„๋„๋กœ ์ง€์ •ํ•˜๊ณ  new๋ฅผ ์ด์šฉํ•ด ๊ฐ์ฒด๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค. (2) QPlayerํด๋ž˜์Šค์— static์œผ๋กœ ์„ ์–ธ๋œ ๊ฐ์ฒด๋ฅผ ๊ฐ€์ ธ์™€ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. alias์˜ ๊ธฐ๋ณธ ๊ฐ’์€ Entity ์ด๋ฆ„ ์ž…๋‹ˆ๋‹ค. (Player์ธ ๊ฒฝ์šฐ player) ๊ตณ์ด..

Querydsl 2021. 7. 17. 00:06
๋ฐ˜์‘ํ˜•
๊ณต์ง€์‚ฌํ•ญ
Total
105,853
Today
47
Yesterday
392
๋งํฌ
«   2021/07   »
์ผ ์›” ํ™” ์ˆ˜ ๋ชฉ ๊ธˆ ํ† 
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
๊ธ€ ๋ณด๊ด€ํ•จ