Skip to content

Commit

Permalink
Merge pull request #119 from MYONGSIK/feature/querydsl
Browse files Browse the repository at this point in the history
[Feature/querydsl] QueryDSL 적용 μ™„λ£Œν•˜μ˜€μŠ΅λ‹ˆλ‹€.
  • Loading branch information
Qbeom0925 authored Apr 26, 2023
2 parents 1a82abe + 0a6946e commit 535ba37
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,33 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'io.micrometer:micrometer-core'
implementation 'io.micrometer:micrometer-registry-prometheus'

//QueryDSL
implementation "com.querydsl:querydsl-jpa"
implementation "com.querydsl:querydsl-core"
implementation "com.querydsl:querydsl-collections"
annotationProcessor "com.querydsl:querydsl-apt:${dependencyManagement.importedProperties['querydsl.version']}:jpa" // querydsl JPAAnnotationProcessor μ‚¬μš© 지정
annotationProcessor "jakarta.annotation:jakarta.annotation-api" // java.lang.NoClassDefFoundError (javax.annotation.Generated) λŒ€μ‘ μ½”λ“œ
annotationProcessor "jakarta.persistence:jakarta.persistence-api" // java.lang.NoClassDefFoundError (javax.annotation.Entity) λŒ€μ‘ μ½”λ“œ
}

tasks.named('test') {
useJUnitPlatform()
}
// Querydsl μ„€μ •λΆ€
def generated = 'build/generated'

// querydsl QClass 파일 생성 μœ„μΉ˜λ₯Ό 지정
tasks.withType(JavaCompile) {
options.getGeneratedSourceOutputDirectory().set(file(generated))
}

// java source set 에 querydsl QClass μœ„μΉ˜ μΆ”κ°€
sourceSets {
main.java.srcDirs += [ generated ]
}

// gradle clean μ‹œμ— QClass 디렉토리 μ‚­μ œ
clean {
delete file(generated)
}

0 comments on commit 535ba37

Please sign in to comment.