Skip to content

Commit

Permalink
⬆️ Upgrade JOOQ from 3.18 to 3.19
Browse files Browse the repository at this point in the history
  • Loading branch information
Lysoun committed Feb 6, 2024
1 parent 382eb4f commit c5cbe61
Show file tree
Hide file tree
Showing 37 changed files with 1,263 additions and 992 deletions.
2 changes: 1 addition & 1 deletion modules/app-server/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies {
implementation(project(":modules:app-server:rest"))

implementation("io.ktor:ktor-server-netty:2.2.4")
implementation("org.jooq:jooq:3.18.2")
implementation("org.jooq:jooq:3.19.3")
implementation(project(":modules:app-server:dao"))
implementation(project(":modules:app-server:domain"))
implementation("org.postgresql:postgresql:42.5.1")
Expand Down
81 changes: 36 additions & 45 deletions modules/app-server/dao/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
plugins {
kotlin("jvm")
id("nu.studer.jooq") version "8.1"
id("org.jooq.jooq-codegen-gradle") version "3.19.3"
}

repositories {
mavenCentral()
}

dependencies {
implementation("org.jooq:jooq:3.18.2")
implementation("org.jooq:jooq:3.19.3")
implementation(project(":modules:app-server:domain"))
implementation("org.postgresql:postgresql:42.5.1")

jooqGenerator("org.postgresql:postgresql:42.5.1")
jooqCodegen("org.postgresql:postgresql:42.5.1")
implementation("jakarta.validation:jakarta.validation-api:3.0.2")

testImplementation("io.strikt:strikt-core:0.34.0")
Expand All @@ -26,43 +26,40 @@ dependencies {
}

jooq {
version.set("3.18.2") // default (can be omitted)
edition.set(nu.studer.gradle.jooq.JooqEdition.OSS) // default (can be omitted)
configuration {
jdbc {
driver = "org.postgresql.Driver"
url = "jdbc:postgresql://localhost:5432/datamaintain"
user = "datamaintain"
password = "datamaintain"
}

generator {
generate {
isDeprecated = false
isRecords = true
isImmutablePojos = true
isFluentSetters = true
isImplicitJoinPathsAsKotlinProperties = true
isKotlinSetterJvmNameAnnotationsOnIsPrefix = true
isPojosAsKotlinDataClasses = true
isValidationAnnotations = true
isKotlinNotNullPojoAttributes = true
}

name = "org.jooq.codegen.KotlinGenerator"
target {
packageName = "generated.domain"
directory = "${project.rootDir}/modules/app-server/dao/src/jooq"
}

configurations {
create("main") { // name of the jOOQ configuration
generateSchemaSourceOnCompilation.set(false)
database {
name = "org.jooq.meta.postgres.PostgresDatabase"
inputSchema = "public"
}

jooqConfiguration.apply {
logging = org.jooq.meta.jaxb.Logging.WARN
jdbc.apply {
driver = "org.postgresql.Driver"
url = "jdbc:postgresql://localhost:5432/datamaintain"
user = "datamaintain"
password = "datamaintain"
}
generator.apply {
name = "org.jooq.codegen.KotlinGenerator"
database.apply {
name = "org.jooq.meta.postgres.PostgresDatabase"
inputSchema = "public"
}
generate.apply {
isDeprecated = false
isRecords = true
isImmutablePojos = true
isFluentSetters = true
isImplicitJoinPathsAsKotlinProperties = true
isKotlinSetterJvmNameAnnotationsOnIsPrefix = true
isPojosAsKotlinDataClasses = true
isValidationAnnotations = true
}
target.apply {
packageName = "generated.domain"
directory = "${project.rootDir}/modules/app-server/dao/src/jooq"
}
strategy.name = "org.jooq.codegen.DefaultGeneratorStrategy"
}
strategy {
name = "org.jooq.codegen.DefaultGeneratorStrategy"
}
}
}
Expand All @@ -71,17 +68,11 @@ jooq {
buildscript {
configurations["classpath"].resolutionStrategy.eachDependency {
if (requested.group == "org.jooq") {
useVersion("3.18.2")
useVersion("3.19.3")
}
}
}

tasks.named<nu.studer.gradle.jooq.JooqGenerate>("generateJooq") {
(launcher::set)(javaToolchains.launcherFor {
languageVersion.set(JavaLanguageVersion.of(Versions.java.toInt()))
})
}

tasks.named("clean") {
doLast {
file("src/jooq").deleteRecursively()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ open class DefaultCatalog : CatalogImpl("") {
*/
val PUBLIC: Public get(): Public = Public.PUBLIC

public override fun getSchemas(): List<Schema> = listOf(
override fun getSchemas(): List<Schema> = listOf(
Public.PUBLIC
)

/**
* A reference to the 3.18 minor release of the code generator. If this
* A reference to the 3.19 minor release of the code generator. If this
* doesn't compile, it's because the runtime library uses an older minor
* release, namely: 3.18. You can turn off the generation of this reference
* release, namely: 3.19. You can turn off the generation of this reference
* by specifying /configuration/generator/generate/jooqVersionReference
*/
private val REQUIRE_RUNTIME_JOOQ_VERSION = Constants.VERSION_3_18
private val REQUIRE_RUNTIME_JOOQ_VERSION = Constants.VERSION_3_19
}
4 changes: 2 additions & 2 deletions modules/app-server/dao/src/jooq/generated/domain/Public.kt
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ open class Public : SchemaImpl("public", DefaultCatalog.DEFAULT_CATALOG) {
*/
val DM_TAG: DmTag get() = DmTag.DM_TAG

public override fun getCatalog(): Catalog = DefaultCatalog.DEFAULT_CATALOG
override fun getCatalog(): Catalog = DefaultCatalog.DEFAULT_CATALOG

public override fun getTables(): List<Table<*>> = listOf(
override fun getTables(): List<Table<*>> = listOf(
DmBatchExecution.DM_BATCH_EXECUTION,
DmBatchExecutionDmFlag.DM_BATCH_EXECUTION_DM_FLAG,
DmEnvironment.DM_ENVIRONMENT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ enum class BatchExecutionOrigin(@get:JvmName("literal") public val literal: Stri
CLIENT("CLIENT"),
SERVER("SERVER"),
TIER("TIER");
public override fun getCatalog(): Catalog? = schema.catalog
public override fun getSchema(): Schema = Public.PUBLIC
public override fun getName(): String = "batch_execution_origin"
public override fun getLiteral(): String = literal
override fun getCatalog(): Catalog? = schema.catalog
override fun getSchema(): Schema = Public.PUBLIC
override fun getName(): String = "batch_execution_origin"
override fun getLiteral(): String = literal
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import org.jooq.Schema
enum class BatchExecutionType(@get:JvmName("literal") public val literal: String) : EnumType {
ON_DEMAND("ON_DEMAND"),
PLANNED("PLANNED");
public override fun getCatalog(): Catalog? = schema.catalog
public override fun getSchema(): Schema = Public.PUBLIC
public override fun getName(): String = "batch_execution_type"
public override fun getLiteral(): String = literal
override fun getCatalog(): Catalog? = schema.catalog
override fun getSchema(): Schema = Public.PUBLIC
override fun getName(): String = "batch_execution_type"
override fun getLiteral(): String = literal
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ enum class ExecutionStatus(@get:JvmName("literal") public val literal: String) :
IN_PROGRESS("IN_PROGRESS"),
COMPLETED("COMPLETED"),
ERROR("ERROR");
public override fun getCatalog(): Catalog? = schema.catalog
public override fun getSchema(): Schema = Public.PUBLIC
public override fun getName(): String = "execution_status"
public override fun getLiteral(): String = literal
override fun getCatalog(): Catalog? = schema.catalog
override fun getSchema(): Schema = Public.PUBLIC
override fun getName(): String = "execution_status"
override fun getLiteral(): String = literal
}
Loading

0 comments on commit c5cbe61

Please sign in to comment.