๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐Ÿ–ฅ๏ธ ๋ฐฑ์—”๋“œ63

[Querydsl] DTO ์กฐํšŒ ๋ฐฉ๋ฒ• ์ˆœ์ˆ˜ JPA์—์„œ DTO ์กฐํšŒ List result = em.createQuery( "select new study.querydsl.dto.MemberDto(m.username, m.age) " + "from Member m", MemberDto.class) .getResultList(); new ๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•ด์•ผํ•จ DTO์˜ package์ด๋ฆ„์„ ๋‹ค ์ ์–ด์ค˜์•ผํ•จ ์ƒ์„ฑ์ž ๋ฐฉ์‹๋งŒ ์ง€์›ํ•จ Querydsl ๋นˆ ์ƒ์„ฑ(Bean population) ๊ฒฐ๊ณผ๋ฅผ DTO ๋ฐ˜ํ™˜ํ•  ๋•Œ ์‚ฌ์šฉํ•จ 3๊ฐ€์ง€ ๋ฐฉ๋ฒ•์œผ๋กœ ์ง€์›ํ•จ ํ”„๋กœํผํ‹ฐ ์ ‘๊ทผ ํ•„๋“œ ์ง์ ‘ ์ ‘๊ทผ ์ƒ์„ฑ์ž ์‚ฌ์šฉ [ํ”„๋กœํผํ‹ฐ ์ ‘๊ทผ - Setter] List result = queryFactory .select(Projections.bean(MemberDto.class, member.user.. 2024. 1. 7.
[์Šคํ”„๋ง] ์—‘์…€ ๋‹ค์šด๋กœ๋“œ 2๊ฐ€์ง€ ๋ฐฉ๋ฒ• (์˜์กด์„ฑ/JSP/์ปจํŠธ๋กค๋Ÿฌ) ์˜์กด์„ฑ ์ถ”๊ฐ€ํ•˜๊ธฐ์—‘์…€ ๋‹ค์šด๋กœ๋“œ๋ฅผ ์œ„ํ•œ ์˜์กด์„ฑ์„ ์ถ”๊ฐ€ํ•œ๋‹ค(maven - pom.xml) org.apache.poi poi 4.1.2 org.apache.poi poi-ooxml 4.1.2  [A]  : ์ž๋ฐ”๋ฅผ ์ด์šฉํ•œ ์—‘์…€ ์ƒ์„ฑ[B]  : JSP์˜ ํƒœ๊ทธ๋ฅผ ๋ฐ”๋กœ Excel ๋ณ€ํ™˜   [A] ๊ธฐ์กด์˜ JPS์— ํƒœ๊ทธ ์ถ”๊ฐ€ํ•˜๊ธฐ์ œ์ถœ์„ ์œ„ํ•œ form ํƒœ๊ทธ์—์„œ action์†์„ฑ ๊ฐ’์€ ๋‹ค์šด๋กœ๋“œ๋ฅผ ์œ„ํ•ด ๋งŒ๋“ค์–ด๋‘” ์ปจํŠธ๋กค๋Ÿฌ์˜ GetMapping ์ฃผ์†Œ๋กœ, method๋Š” Get์œผ๋กœ ์„ค์ •ํ•œ๋‹ค. ๋‹ค์šด๋กœ๋“œํ•  ํŽ˜์ด์ง€์— ๊ทธ์™ธ์˜ ๊ฐ’์ด ํ•„์š”ํ•œ ๊ฒฝ์šฐ ์ œ์ถœํ•  ํƒœ๊ทธ๋“ค์„.. 2024. 1. 4.
[์„ค์ •] ๊น€์˜ํ•œ SpringBoot JPA ๊ฐ•์˜ ํ”„๋กœ์ ํŠธ 3.X.X ์„ค์น˜ ์˜ค๋ฅ˜ ํ•ด๊ฒฐ https://start.spring.io/ ์ƒ์„ฑ ํ”„๋กœ์ ํŠธ ์˜ค๋ฅ˜๋กœ ์‹คํ–‰ ๋ถˆ๊ฐ€ ๊ฐ•์˜์— ๋‚˜์˜จ ๋‚ด์šฉ๋Œ€๋กœ https://start.spring.io/ ์—์„œ ํ”„๋กœ์ ํŠธ๋ฅผ ๋งŒ๋“ค๊ณ  IDE์—์„œ ์˜คํ”ˆํ–ˆ์ง€๋งŒ Gradle๊ณผ Java๋ฒ„์ „์ด ์•ˆ๋งž๋Š”๋‹ค๋Š” ์˜ค๋ฅ˜๋กœ ์‹คํ–‰์กฐ์ฐจ ์•ˆ๋จ ์˜ค๋ฅ˜ ๋ฉ”์„ธ์ง€ ๋”๋ณด๊ธฐ A problem occurred configuring root project 'datastudy'. > Could not resolve all files for configuration ':classpath'. > Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.1.6. Required by: project : > org.springframework.boot:o.. 2023. 12. 17.
[์„ค์ •] SpringBoot + MyBatis + Oracle + JSP ์—ฐ๋™ ํ”„๋กœ์ ํŠธ ํ™˜๊ฒฝ ์„ค์ • ์ •๋ณด SpringBoot๋Š” ์ฃผ๋กœ JPA์™€ Thymeleaf๋ฅผ ํŒŒํŠธ๋„ˆ๋กœ ์‚ผ์•„ ๊ฐœ๋ฐœ์ž๋“ค์—๊ฒŒ ๋„๋ฆฌ ์•Œ๋ ค์ ธ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ ๊ธฐ์ˆ ์˜ ์„ธ๊ณ„์—์„œ๋Š” ์–ธ์ œ๋‚˜ ์˜ˆ์™ธ๊ฐ€ ์กด์žฌํ•ฉ๋‹ˆ๋‹ค..... ๋ณธ ๊ธ€์—์„œ๋Š” SpringBoot๋ฅผ MyBatis์™€ Oracle DB์— ์—ฐ๊ฒฐํ•˜๊ณ , JSP๋ฅผ ํ™œ์šฉํ•˜์—ฌ ๋ทฐ๋ฅผ ๊ตฌ์„ฑํ•˜๋Š” ๊ณผ์ •์— ํ•„์š”ํ•œ ์„ค์ •๋“ค์— ๋Œ€ํ•ด ๊ธฐ๋กํ•˜์˜€์Šต๋‹ˆ๋‹ค. ํ”„๋กœ์ ํŠธ ํ™˜๊ฒฝ์€ ์ธํ…”๋ฆฌ์ œ์ด์™€ ์œˆ๋„์šฐ์ด๋ฉฐ, ๊ฒŒ์‹œํŒ์˜ ๊ธ€๋ชฉ๋ก์„ ๋ถˆ๋Ÿฌ์˜ค๊ธฐ๊นŒ์ง€์˜ ๊ฐ„๋‹จํ•œ ์ฝ”๋“œ๋กœ ์ด๋ฃจ์–ด์ ธ์žˆ์Šต๋‹ˆ๋‹ค. ์Šคํ”„๋ง๋ถ€ํŠธ 2.X.X ๋ฒ„์ „, ์ž๋ฐ” 11 ๋“ฑ ๋‚ฎ์€ ๋ฒ„์ „์ผ ๋•Œ์˜ ์„ค์ •์ž…๋‹ˆ๋‹ค. ์ค€๋น„๋ฌผ: SpringBoot ํ”„๋กœ์ ํŠธ ์ด ๊ธ€์—์„œ ์‚ฌ์šฉํ•˜๋Š” build.gradle ์ž…๋‹ˆ๋‹ค. plugins { id 'org.springframework.boot' version '2.4.1' //์Šคํ”„๋ง๋ถ€ํŠธ 2.X... 2023. 12. 11.
[Java] ๋ถ€ํŠธ์บ ํ”„ ๊ฐœ๊ฐ• ์ „ ์ž๋ฐ” ๋…ํ•™ ๊ธฐ๋ก (NaverBlog ์ž๋ฐ”์˜ ์ •์„ 3ํŒ ์š”์•ฝ์ •๋ฆฌ) ํ‘œ๋กœ ์ •๋ฆฌํ•˜๋Š” ๊ฒƒ์€ ์นดํ…Œ๊ณ ๋ฆฌ ๊ตฌ๋ถ„์œผ๋กœ ์ดํ•ด์— ํฐ ๋„์›€์ด ๋˜์—ˆ์ง€๋งŒ, ๋‹ค๋ฅธ ํ”Œ๋žซํผ์œผ๋กœ ๊ธ€์„ ์˜ฎ๊ธฐ๋Š” ๊ฒƒ์—๋Š” ์ข€ ๋ถˆํŽธํ–ˆ๋‹ค. ๊ทธ๋ž˜์„œ ๋‚˜์˜ ์ด์ „ ๋ธ”๋กœ๊ทธ ๋งํฌ๋งŒ ๊ฐ€์ ธ์˜ค๋ ค๊ณ  ํ•œ๋‹ค. ๋ณธ๋ฌธ์€ 2023๋…„ ์ดˆ์— ๊ฐœ๋ฐœ๊ณต๋ถ€๋ฅผ ๋งˆ์Œ๋จน๊ณ  ์ž๋ฐ”์˜ ์ •์„ ์ฑ…์„ ๊ณต๋ถ€ํ•˜๋ฉฐ ์ž‘์„ฑํ•œ ๋ธ”๋กœ๊ทธ๊ธ€์˜ ๋งํฌ๋“ค์ด๋‹ค. ์ •๋ง ์•„๋ฌด๊ฒƒ๋„ ๋ชจ๋ฅผ ๋•Œ ์ฑ…์„ ์ดํ•ดํ•˜๋ ค๊ณ  ์‹œ์ž‘ํ•œ ์ •๋ฆฌ์ด๋‹ค๋ณด๋‹ˆ ํ‹€๋ฆฐ๋ถ€๋ถ„์ด ์กด์žฌํ•  ์ˆ˜ ์žˆ๋‹ค....ใ…Žใ…Ž ์ด๋•Œ ์ •๋ฆฌ๋ฅผ ํ†ตํ•œ ์ง€์‹ ํ†ตํ•ฉ์˜ ๊ฒฝํ—˜ ๋•๋ถ„์— 3๋ฒˆ์ด๋‚˜ ๋” ์ž๋ฐ”์˜ ์ •์„์„ ํ›‘๊ณ  ์ •๋ฆฌํ–ˆ์—ˆ๋‹ค(์•„๋ž˜ ๋ฐœํ–‰ ๊ธ€์— ๊ธฐ๋กํ•ด๋‘ ) 2023.12.07 - [๐Ÿ“œ ํ•™์Šต ๊ธฐ๋ก] - [ํ•™์Šต ๊ธฐ๋ก] ์ž๋ฐ”์˜ ์ •์„ ์š”์•ฝ์ •๋ฆฌ ๊ณต๋ถ€์˜ ์—ญ์‚ฌ ๐Ÿ˜Ž ch.2 ๋ณ€์ˆ˜ https://blog.naver.com/hhju2016/222983636938 ์ž๋ฐ”์˜์ •์„ ch.2 ์š”์•ฝ์ •๋ฆฌ ๋ณ€์ˆ˜, ๋ณ€์ˆ˜์˜ํƒ€์ž….. 2023. 12. 7.
[Querydsl] Querydsl ์‚ฌ์šฉ์„ ์œ„ํ•œ ์ค€๋น„ Query DSL์„ ์‚ฌ์šฉํ•˜๋ ค๋ฉด QOrder, QMember.. ์™€ ๊ฐ™์€ query order query ํŒŒ์ผ์„ ์ƒ์„ฑํ•ด ์ค˜์•ผํ•จ ์Šคํ”„๋ง๋ถ€ํŠธ 3.X.X ์ž…๋‹ˆ๋‹ค. ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์ถ”๊ฐ€ build.gradle //Querydsl ์ถ”๊ฐ€ ๋นŒ๋“œ ๊ณผ์ •์†์— Qdsl์„ ๋„ฃ์€ ๊ฒƒ implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta' annotationProcessor "com.querydsl:querydsl-apt:${dependencyManagement.importedProperties['querydsl.version']}:jakarta" annotationProcessor "jakarta.annotation:jakarta.annotation-api" annotationProces.. 2023. 11. 30.
Character ํด๋ž˜์Šค ์ฃผ์š” ๋ฉ”์„œ๋“œ char charValue():์ด Character ๊ฐ์ฒด๊ฐ€ ๋‚˜ํƒ€๋‚ด๋Š” char ๊ฐ’์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. int compareTo(Character anotherCharacter):๋‘ Character ๊ฐ์ฒด์˜ ์ˆœ์„œ๋ฅผ ๋น„๊ตํ•ฉ๋‹ˆ๋‹ค. static int compare(char x, char y):๋‘ char ๊ฐ’์„ ๋น„๊ตํ•ฉ๋‹ˆ๋‹ค. static boolean isLetter(char ch):์ง€์ •๋œ char ๊ฐ’์ด ๋ฌธ์ž์ธ์ง€ ์—ฌ๋ถ€๋ฅผ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค. static boolean isDigit(char ch):์ง€์ •๋œ char ๊ฐ’์ด ์ˆซ์ž์ธ์ง€ ์—ฌ๋ถ€๋ฅผ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค. static boolean isWhitespace(char ch):์ง€์ •๋œ char ๊ฐ’์ด ๊ณต๋ฐฑ ๋ฌธ์ž์ธ์ง€ ์—ฌ๋ถ€๋ฅผ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค. static boolean isUpperCase(char ch).. 2023. 11. 30.