Created
November 17, 2022 21:07
-
-
Save MavoCz/b8ec3fe052d3ad7f44d4fa300bf3da2d to your computer and use it in GitHub Desktop.
Jooq code generation gradle task
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
jooq { | |
version.set("3.16.7") | |
edition.set(JooqEdition.OSS) | |
configurations { | |
create("main") { | |
jooqConfiguration.apply { | |
logging = Logging.WARN | |
jdbc.apply { | |
driver = "org.postgresql.Driver" | |
url = "jdbc:postgresql://localhost:5432/postgres" | |
user = "postgres" | |
password = "" | |
properties = listOf( | |
Property().apply { | |
key = "PAGE_SIZE" | |
value = "2048" | |
} | |
) | |
} | |
generator.apply { | |
name = "org.jooq.codegen.KotlinGenerator" | |
database.apply { | |
name = "org.jooq.meta.postgres.PostgresDatabase" | |
inputSchema = "public" | |
forcedTypes = listOf( | |
ForcedType().apply { | |
name = "varchar" | |
includeExpression = ".*" | |
includeTypes = "JSONB?" | |
}, | |
ForcedType().apply { | |
isEnumConverter = true | |
userType = "net.voldrich.myhome.server.api.ItemState" | |
includeExpression = ".*item.state" | |
includeTypes = ".*" | |
} | |
) | |
} | |
generate.apply { | |
isDeprecated = false | |
isRecords = true | |
isImmutablePojos = false | |
isFluentSetters = true | |
//withPojos(true) | |
//withDaos(true) | |
//withSerializablePojos(false) | |
withSequences(true) | |
} | |
target.apply { | |
packageName = "net.voldrich.myhome.jooq" | |
directory = "src/generated/jooq" | |
} | |
strategy.name = "org.jooq.codegen.DefaultGeneratorStrategy" | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment