我正在尝试在我的项目中使用 QDataTableRepository 。这让我必须导入querydsl。
构建.gradle
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'idea'
repositories {
mavenCentral()
}
dependencies {
compile("org.springframework.boot:spring-boot-devtools")
compile('org.springframework.boot:spring-boot-starter')
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.postgresql:postgresql:9.4.1212')
compile('org.projectlombok:lombok:1.16.10')
compile group: 'com.github.darrachequesne', name: 'spring-data-jpa-datatables', version: '3.1'
compile group: 'com.querydsl', name: 'querydsl-jpa', version: '4.1.4'
compile group: 'com.querydsl', name: 'querydsl-apt', version: '4.1.4'
testCompile('org.springframework.boot:spring-boot-starter-test')
}
configurations {
querydslapt
}
sourceSets {
generated
}
sourceSets.generated.java.srcDirs = ['generated/']
task generateQueryDSL(type: JavaCompile, group: 'build', description: 'Generates the QueryDSL query types') {
source = sourceSets.main.java
classpath = configurations.compile …Run Code Online (Sandbox Code Playgroud)