๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๋ฐ˜์‘ํ˜•

๊ฐœ๋ฐœ93

[JPA] Specification์„ ์ด์šฉํ•˜์—ฌ ์ฟผ๋ฆฌ ์กฐ๊ฑด ์ฒ˜๋ฆฌํ•˜๊ธฐ - ์™ธ๋ž˜ํ‚ค Specification Repository์— JpaSpecificationExecutor ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ์ƒ์†๋ฐ›์œผ๋ฉด Specification์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค. @Repository public interface GrandChildRepository extends JpaRepository, JpaSpecificationExecutor { } โ€ป์ฐธ๊ณ  : ๋ณตํ•ฉํ‚ค์ด๊ธฐ ๋•Œ๋ฌธ์— JpaRepository๋ฅผ ์ƒ์†๋ฐ›์„ ๋•Œ ID๋ถ€๋ถ„์— Id class๋ฅผ ๋„ฃ์–ด์ฃผ๋ฉด ๋œ๋‹ค. ๊ด€๋ จ ๋‚ด์šฉ์€ ์•„๋ž˜ ํฌ์ŠคํŒ…์„ ์ฐธ๊ณ ํ•˜์ž [JPA] ๋ณตํ•ฉํ‚ค, ์™ธ๋ž˜ํ‚ค Entity ์„ค์ •ํ•˜๊ธฐ(@IdClass๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์‹๋ณ„๊ด€๊ณ„ ๋งคํ•‘) ์˜ฌํ•ด ์ดˆ ๋ณตํ•ฉํ‚ค, ์™ธ๋ž˜ํ‚ค ์‚ฌ์šฉ์ด ๋งŽ์€ ํ…Œ์ด๋ธ”์„ JPA Entity๋กœ ๊ตฌํ˜„ํ–ˆ์–ด์•ผ ํ–ˆ๋Š”๋ฐ, JPA ์‚ฌ์šฉ์ด ์ฒ˜์Œ์ด์˜€์–ด์„œ ์ต์ˆ™ํ•˜์ง€ ์•Š์•„ ๋ณต.. 2022. 1. 7.
[MyBatis] ๋ฐ˜๋ณต๋˜๋Š” ์ฟผ๋ฆฌ ์ž‘์„ฑํ•˜๊ธฐ <foreach> collection ์ธ์ž(Map, Array, List, Set ๋“ฑ..) ๊ฐ’์œผ๋กœ ๋ฐ˜๋ณต์ ์ธ SQL ๊ตฌ๋ฌธ์„ ์ž‘์„ฑํ•˜๊ธฐ ์œ„ํ•ด ์‚ฌ์šฉ๋œ๋‹ค. (OR ๋˜๋Š” IN ๊ตฌ๋ฌธ์—์„œ ์ฃผ๋กœ ์‚ฌ์šฉ๋œ๋‹ค.) foreach๋Š” 6๊ฐœ์˜ ์†์„ฑ์ด ์žˆ๋‹ค. collection - ์ „๋‹ฌ๋ฐ›์€ ์ธ์ž (Map, Array, List, Set๋“ฑ๊ณผ ๊ฐ™์€ ๊ฐ์ฒด) item - collection ์†์„ฑ์—์„œ ์ „๋‹ฌ๋ฐ›์€ ์ธ์ž๊ฐ’์„ alias๋ช…์œผ๋กœ ๋Œ€์ฒด open - ํ•ด๋‹น ๊ตฌ๋ฌธ์ด ์‹œ์ž‘๋  ๋•Œ ์‚ฝ์ž…ํ•  ๋ฌธ์ž์—ด close - ํ•ด๋‹น ๊ตฌ๋ฌธ์ด ์ข…๋ฃŒ๋  ๋•Œ ์‚ฝ์ž…ํ•  ๋ฌธ์ž์—ด separator - ๋ฐ˜๋ณต๋˜๋Š” ๊ตฌ๋ฌธ ์‚ฌ์ด์— ์‚ฝ์ž…ํ•  ๋ฌธ์ž์—ด (๊ตฌ๋ฌธ์„ ๋ถ„๋ฆฌํ•˜๊ธฐ ์œ„ํ•œ ๋ฌธ์ž) index - ๋ฐ˜๋ณต๋˜๋Š” ๊ตฌ๋ฌธ ๋ฒˆํ˜ธ. 0๋ถ€ํ„ฐ ์ˆœ์ฐจ์ ์œผ๋กœ ์ฆ๊ฐ€ ์˜ˆ์ œ a, b, c๊ฐ€ ๋‹ด๊ฒจ ์žˆ๋Š” list๊ฐ€ ์žˆ๊ณ , ํ•ด๋‹น list์— ํ•ด๋‹นํ•˜๋Š” ๊ฐ’.. 2022. 1. 6.
[JBoss] ๋กœ๊น… ๋ฌธ์ œ, ์ž์ฒด์ ์œผ๋กœ ์‚ฌ์šฉํ•˜๋Š” ๋กœ๊ทธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์ œ์™ธํ•˜๊ธฐ JBOSS๋Š” ์ž์ฒด์ ์œผ๋กœ ๋กœ๊ทธ ๋ชจ๋“ˆ์„ ์‚ฌ์šฉํ•œ๋‹ค. ๋•Œ๋ฌธ์— slf4j ๋กœ๊ทธ ๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ•˜๋Š” ์›น ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์„ deployํ•˜๊ฒŒ ๋˜๋ฉด ์ถฉ๋Œ์ด ๋ฐœ์ƒํ•˜์—ฌ ๋กœ๊ทธ๊ฐ€ ์ œ๋Œ€๋กœ ๋‚จ์ง€ ์•Š๋Š”๋‹ค. ๋”ฐ๋ผ์„œ ๊ฐœ๋ณ„ Web Application์— JBOSS ๋กœ๊น… ๋ชจ๋“ˆ์„ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋„๋ก ์ œ์™ธ ์‹œ์ผœ์•ผ ํ•œ๋‹ค. ํ•ด๊ฒฐ๋ฐฉ๋ฒ• 1. JBOSS ์ธ์Šคํ„ด์Šค ์˜ต์…˜ ์ถ”๊ฐ€ JBOSS ์‹œ์ž‘ ์˜ต์…˜์— ์•„๋ž˜ ์„ค์ •์„ ์ถ”๊ฐ€ํ•˜์—ฌ ์ž์ฒด ๋กœ๊ทธ ๋ชจ๋“ˆ์„ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋„๋ก ํ•œ๋‹ค. Standalone -Dorg.jboss.as.logging.per-deployment=false ๋„๋ฉ”์ธ 2. Web Application์— jboss-deployment-structure.xml ์ถ”๊ฐ€ํ•˜์—ฌ ๋ฐฐํฌ ์œ„์น˜ WAR : WEB-INF/jboss-deployment-structure.xml EAR : M.. 2021. 12. 31.
[Maven] ์œˆ๋„์šฐ์— ๋ฉ”์ด๋ธ ์„ค์น˜ ๋ฐ ํ™˜๊ฒฝ ๋ณ€์ˆ˜ ์„ค์ • 1. Mavne ์‚ฌ์ดํŠธ์—์„œ ๋‹ค์šด๋กœ๋“œ ์ž„์˜์˜ ์œ„์น˜์— ๋‹ค์šด๋กœ๋“œ ํ›„ ์••์ถ• ํ•ด์ œ Maven – Welcome to Apache Maven Welcome to Apache Maven Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information. If you maven.apache.org 2. ์‹œ์Šคํ…œ์˜ PATH ํ™˜๊ฒฝ ๋ณ€์ˆ˜์— mavne bin ๋””๋ ‰ํ† ๋ฆฌ ๋“ฑ๋ก ์ œ์–ดํŒ>์‹œ์Šคํ…œ ๋ฐ ๋ณด์•ˆ>์‹œ.. 2021. 12. 30.
[Linux] netstat ๋ช…๋ น์–ด๋กœ ๋„คํŠธ์›Œํฌ ์ƒํƒœ ํ™•์ธํ•˜๊ธฐ(+ TCP ์ƒํƒœ ์ „์ด) ์„œ๋ฒ„๋ฅผ ์šด์˜ํ•˜๋‹ค๋ณด๋ฉด ๋„คํŠธ์›Œํฌ ์ƒํƒœ๋ฅผ ํ™•์ธํ•ด์•ผํ•  ์ผ์ด ์ƒ๊ธด๋‹ค.. ์šด์˜์ด ์•„๋‹ˆ๋”๋ผ๋„ ๊ฐœ๋ฐœ์ž๋ผ๋ฉด ํ• ์ผ์ด ์ƒ๊ธฐ๋Š”.. netstat๋ž€? ์ „์†ก ์ œ์–ด ํ”„๋กœํ† ์ฝœ, ๋ผ์šฐํŒ… ํ…Œ์ด๋ธ”, ์ˆ˜๋งŽ์€ ๋„คํŠธ์›Œํฌ ์ธํ„ฐํŽ˜์ด์Šค, ๋„คํŠธ์›Œํฌ ํ”„๋กœํ† ์ฝœ ํ†ต๊ณ„๋ฅผ ์œ„ํ•œ ๋„คํŠธ์›Œํฌ ์—ฐ๊ฒฐ์„ ๋ณด์—ฌ์ฃผ๋Š” ๋ช…๋ น ์ค„ ๋„๊ตฌ์ด๋‹ค. (์œ„ํ‚ค๋ฐฑ๊ณผ : https://ko.wikipedia.org/wiki/Netstat) ์‚ฌ์šฉ๋ฐฉ๋ฒ• netstat [์˜ต์…˜] [ | grep ํฌํŠธ๋ฒˆํ˜ธ or ์„œ๋น„์Šค ๋ช…] ์˜ต์…˜ -l (listen) : ์—ฐ๊ฒฐ ๊ฐ€๋Šฅํ•œ ์ƒํƒœ -n (number port) : ํฌํŠธ ๋„˜๋ฒ„ -t (tcp) : tcp -u (udp) : udp -p : ํ”„๋กœ๊ทธ๋žจ ์ด๋ฆ„ / PID -a : ๋ชจ๋‘ -i : ์ด๋”๋„ท ์นด๋“œ๋ณ„ ์ •์ƒ/์—๋Ÿฌ/๋“œ๋ž ์†ก์ˆ˜์‹  ํŒจํ‚ท ์ˆ˜ ํ™•์ธ -r : ๋ผ์šฐํŒ… ํ…Œ์ด๋ธ” -s .. 2021. 12. 29.
[builtwith] ๊ธฐ์ˆ  ์ •๋ณด ๋ฐ ํ˜„ํ™ฉ ์‚ฌ์ดํŠธ ์ถ”์ฒœ! ํŠน์ • ์›น ์‚ฌ์ดํŠธ์˜ ๊ธฐ์ˆ ์ •๋ณด๊ฐ€ ๊ถ๊ธˆํ•˜๋‹ค๋ฉด? ๊ฐœ๋ฐœ์ž๋“ค์€ ํŠน์ • ์‚ฌ์ดํŠธ์— ๋ฐฉ๋ฌธํ–ˆ์„ ๋•Œ ์–ด๋–ค ๊ธฐ์ˆ ์ด ์‚ฌ์šฉ๋˜์—ˆ๋Š”์ง€ ๊ถ๊ธˆํ•œ ๊ฒฝ์šฐ๊ฐ€ ์žˆ๋‹ค. ๊ฐœ๋ฐœ์ž๋„๊ตฌ๋ฅผ ํ†ตํ•ด ์–ด๋Š์ •๋„๋Š” ํŒŒ์•…ํ•  ์ˆ˜ ์žˆ์ง€๋งŒ.. ํ•œ๊ณ„๊ฐ€ ์žˆ๊ธฐ์—! builtwith์—์„œ๋Š” ์‚ฌ์ดํŠธ์˜ ๊ธฐ์ˆ  ์ •๋ณด ๋ฟ๋งŒ ์•„๋‹ˆ๋ผ ๋ชจ๋“  ์›น ๊ธฐ์ˆ ์— ๋Œ€ํ•œ ์‹œ์žฅ ์ ์œ ์œจ ์ •๋ณด ๋ฐ ๊ตญ๊ฐ€๋ณ„ ๋ถ„์„ ๋‚ด์šฉ๋„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค! BuiltWith Web Technology Usage Statistics Public Companies View a list of all technologies that are owned by publicly traded companies. trends.builtwith.com ์•„๋ž˜๋Š” ๋ฆฌ์•กํŠธ ๊ธฐ์ˆ ์˜ ์‚ฌ์šฉ ํ†ต๊ณ„์ด๋‹ค Top 1m์€ ์ „์„ธ๊ณ„ ์ƒ์œ„ 1๋งŒ ๊ฐœ์˜ ์›น์‚ฌ์ดํŠธ ์ค‘์— react๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๋น„์œจ์ด๋‹ค! ๋ฆฌ์•กํŠธ์˜ ๊ธฐ์ˆ ์ด ์–ผ๋งˆ๋‚˜ ๋งŽ.. 2021. 12. 28.
[DB] GROUP BY ๊ฐ ๊ทธ๋ฃน์—์„œ ๋งˆ์ง€๋ง‰(์ตœ์‹ ) ๋ฐ์ดํ„ฐ ๊ฐ€์ ธ์˜ค๊ธฐ GROUP BY๋Š” ์ง‘๊ณ„ ํ•จ์ˆ˜์˜ ๊ฒฐ๊ณผ๋ฅผ ํŠน์ • ์นผ๋Ÿผ ๊ธฐ์ค€์œผ๋กœ ๋ฌถ์–ด ์ถœ๋ ฅํ•ด์ฃผ๋Š” ์ฟผ๋ฆฌ์ธ๋ฐ GROUP BY๋ฅผ ํ•˜๊ฒŒ ๋˜๋ฉด ํŠน์ • ์นผ๋Ÿผ๊ณผ ์ง‘๊ณ„ ํ•จ์ˆ˜ ์™ธ์— ๋‹ค๋ฅธ ์ปฌ๋Ÿผ์€ ์กฐํšŒํ•  ์ˆ˜๊ฐ€ ์—†๋‹ค. PostgreSQL๊ฐ™์€ ๊ฒฝ์šฐ๋Š” ๋‹ค๋ฅธ ์นผ๋Ÿผ์„ ์กฐํšŒํ•˜๋ ค๊ณ  ํ•˜๋ฉด ์•„๋ž˜์™€ ๊ฐ™์€ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•œ๋‹ค. SQL Error [42803]: ์˜ค๋ฅ˜: column "test.id" ๋Š” ๋ฐ˜๋“œ์‹œ GROUP BY ์ ˆ๋‚ด์— ์žˆ์–ด์•ผ ํ•˜๋˜์ง€ ๋˜๋Š” ์ง‘๊ณ„ ํ•จ์ˆ˜ ๋‚ด์—์„œ ์‚ฌ์šฉ๋˜์–ด์ ธ์•ผ ํ•œ๋‹ค MySQL์€ GROUP BY์˜ ์นผ๋Ÿผ ์™ธ์—๋„ ์กฐํšŒ๊ฐ€ ๊ฐ€๋Šฅํ•˜์ง€๋งŒ ์ •ํ™•ํ•œ ๋ฐ์ดํ„ฐ๊ฐ€ ์•„๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ํŠน์ • ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์— ๊ตฌ์• ๋ฐ›์ง€ ์•Š์•„์•ผ ํ•œ๋‹ค. name ์นผ๋Ÿผ์„ group by ํ•˜์—ฌ ๋งˆ์ง€๋ง‰ ๋‚ ์งœ์˜ value๋ฅผ ๊ฐ€์ ธ์˜ค๋Š” ์ฟผ๋ฆฌ๋ฅผ ์ž‘์„ฑํ•˜๊ณ ์ž ํ–ˆ๋‹ค. ๋ฐ์ดํ„ฐ๋Š” ์•„๋ž˜์™€ ๊ฐ™๋‹ค. name๋ณ„ value์˜ ํ•ฉ๊ณ„๋Š” ๊ฐ„.. 2021. 12. 24.
[JPA] ๋ณตํ•ฉํ‚ค, ์™ธ๋ž˜ํ‚ค Entity ์„ค์ •ํ•˜๊ธฐ(@IdClass๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์‹๋ณ„๊ด€๊ณ„ ๋งคํ•‘) ์˜ฌํ•ด ์ดˆ ๋ณตํ•ฉํ‚ค, ์™ธ๋ž˜ํ‚ค ์‚ฌ์šฉ์ด ๋งŽ์€ ํ…Œ์ด๋ธ”์„ JPA Entity๋กœ ๊ตฌํ˜„ํ–ˆ์–ด์•ผ ํ–ˆ๋Š”๋ฐ, JPA ์‚ฌ์šฉ์ด ์ฒ˜์Œ์ด์˜€์–ด์„œ ์ต์ˆ™ํ•˜์ง€ ์•Š์•„ ๋ณต์žกํ•˜๊ฒŒ ๋Š๊ปด์กŒ์—ˆ๋‹ค. ๋‚˜๊ฐ™์€ ์‚ฌ๋žŒ์„ ์œ„ํ•ด ์ •๋ฆฌํ•ด ๋ณธ๋‹ค! Entity์— ๋ณตํ•ฉํ‚ค๋ฅผ ํ†ตํ•œ ์‹๋ณ„๊ด€๊ณ„๋ฅผ ๋งคํ•‘ํ•˜๋Š” ๋ฐฉ๋ฒ•์€ @IdClass, @EmbededId ๋‘๊ฐ€์ง€๊ฐ€ ์žˆ๋Š”๋ฐ ๋ณธ์ธ์€ @IdClass๋ฅผ ์‚ฌ์šฉํ–ˆ๋‹ค. @EmbededId๋Š” @IdClass ๋ฐฉ์‹ ๋ณด๋‹ค ์ข€๋” ๊ฐ์ฒด์ง€ํ–ฅ ๋ฐฉ์‹์ด๋ผ๊ณ  ํ•œ๋‹ค. ํ•˜์ง€๋งŒ ํŠน์ • ๊ฐ์ฒด๋ฅผ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด์„œ ๊ฐ์ฒด ๊ทธ๋ž˜ํ”„๋ฅผ ๊นŠ๊ฒŒ ํƒ์ƒ‰ํ•ด์•ผํ•˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ์žˆ๊ณ , ๊นŠ์ด ๊ฐ์ถฐ์ ธ ์žˆ์–ด์„œ ๋ช…์‹œ์ ์œผ๋กœ ๋ณด์ด์ง€ ์•Š๋Š”๋‹ค๊ณ .. ์˜ˆ๋ฅผ ๋“ค์–ด grandChild Entity์—์„œ parent_id๋ฅผ ๊ตฌํ•˜๊ธฐ ์œ„ํ•ด์„  ์•„๋ž˜์™€ ๊ฐ™์ด ํƒ์ƒ‰ํ•ด์•ผ ํ•œ๋‹ค. grandChild.getGId().getCId().getPI.. 2021. 12. 23.
728x90
๋ฐ˜์‘ํ˜•