Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
jooq jpa entity로 부터 뽑아내기
buildscript {
repositories {
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath("nu.studer:gradle-jooq-plugin:3.0.3")
}
}
apply plugin: 'nu.studer.jooq'
dependencies {
jooqRuntime 'org.jooq:jooq:3.11.11'
jooqRuntime 'org.jooq:jooq-meta-extensions:3.11.11'
jooqRuntime(files(sourceSets.main.output.classesDirs))
}
jooq {
version = '3.11.11'
edition = 'OSS'
project(sourceSets.main) {
generator {
strategy {
name = "com.mycompany.JQPrefixGeneratorStrategy"
}
database {
name = 'org.jooq.meta.extensions.jpa.JPADatabase'
properties {
property {
key = "packages"
value = "com.mycompany.model"
}
}
includes = ".*"
}
target {
packageName = 'org.jooq'
directory = 'src/main/generated'
encoding = 'UTF-8'
}
}
}
}
project.tasks.getByName('compileJava').dependsOn -= 'generateProjectJooqSchemaSource'
import org.jooq.codegen.DefaultGeneratorStrategy;
import org.jooq.meta.Definition;
public class JQPrefixGeneratorStrategy extends DefaultGeneratorStrategy {
@Override
public String getJavaClassName(Definition definition, Mode mode) {
return "JQ" + super.getJavaClassName(definition, mode);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment