Created
May 30, 2022 08:50
-
-
Save haipham22/d21c6d1688b9e620be9c808506e57cfe to your computer and use it in GitHub Desktop.
Springboot JPA + Gradle + Querydsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
ext { | |
queryDslVersion = '5.0.0' | |
} | |
} | |
plugins { | |
... | |
} | |
compileJava { | |
options.annotationProcessorPath = configurations.annotationProcessor | |
} | |
configurations { | |
compileOnly { | |
extendsFrom annotationProcessor | |
} | |
} | |
dependencies { | |
... | |
//QueryDSL | |
implementation "com.querydsl:querydsl-core:${queryDslVersion}" | |
implementation "com.querydsl:querydsl-jpa:${queryDslVersion}" | |
annotationProcessor "com.querydsl:querydsl-apt:${queryDslVersion}:jpa" | |
annotationProcessor "javax.annotation:javax.annotation-api" | |
annotationProcessor "org.springframework.boot:spring-boot-starter-data-jpa" // needed because the query dsl annotation processor doesn't recognize javax.persistence.Entity | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@QueryEntities(value = {AnyEntity.class}) | |
package xyz.abc.module.entity; | |
import com.querydsl.core.annotations.QueryEntities; | |
import xyz.abc.core.entity.AnyEntity; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment