Skip to content

Commit

Permalink
Update jOOQ generated classes
Browse files Browse the repository at this point in the history
  • Loading branch information
IRus committed Dec 28, 2023
1 parent e5bed97 commit 524286f
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 84 deletions.
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ postgresql = "42.7.1"
serialization = "1.6.2"

[libraries]
flyway = { module = "org.flywaydb:flyway-core", version.ref = "flyway" }
flyway-database-postgresql = { module = "org.flywaydb:flyway-database-postgresql", version.ref = "flyway" }

jooq-core = { module = "org.jooq:jooq", version.ref = "jooq" }
jooq-codegen = { module = "org.jooq:jooq-codegen", version.ref = "jooq" }
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=3e1af3ae886920c3ac87f7a91f816c0c7c436f276a6eefdb3da152100fef72ae
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionSha256Sum=9d926787066a081739e8200858338b4a69e837c3a821a33aca9db09dd4a41026
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
14 changes: 7 additions & 7 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -202,11 +202,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ open class DefaultCatalog : CatalogImpl("") {
)

/**
* 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
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,28 @@ import io.heapy.kotbot.database.keys.UPDATE_RAW_PK
import io.heapy.kotbot.database.tables.records.UpdateRawRecord

import java.time.LocalDateTime
import java.util.function.Function

import kotlin.collections.Collection

import org.jooq.Condition
import org.jooq.Field
import org.jooq.ForeignKey
import org.jooq.Identity
import org.jooq.InverseForeignKey
import org.jooq.JSONB
import org.jooq.Name
import org.jooq.PlainSQL
import org.jooq.QueryPart
import org.jooq.Record
import org.jooq.Records
import org.jooq.Row3
import org.jooq.SQL
import org.jooq.Schema
import org.jooq.SelectField
import org.jooq.Select
import org.jooq.Stringly
import org.jooq.Table
import org.jooq.TableField
import org.jooq.TableOptions
import org.jooq.UniqueKey
import org.jooq.impl.DSL
import org.jooq.impl.Internal
import org.jooq.impl.SQLDataType
import org.jooq.impl.TableImpl

Expand All @@ -37,19 +41,23 @@ import org.jooq.impl.TableImpl
@Suppress("UNCHECKED_CAST")
open class UpdateRaw(
alias: Name,
child: Table<out Record>?,
path: ForeignKey<out Record, UpdateRawRecord>?,
path: Table<out Record>?,
childPath: ForeignKey<out Record, UpdateRawRecord>?,
parentPath: InverseForeignKey<out Record, UpdateRawRecord>?,
aliased: Table<UpdateRawRecord>?,
parameters: Array<Field<*>?>?
parameters: Array<Field<*>?>?,
where: Condition?
): TableImpl<UpdateRawRecord>(
alias,
Public.PUBLIC,
child,
path,
childPath,
parentPath,
aliased,
parameters,
DSL.comment(""),
TableOptions.table()
TableOptions.table(),
where,
) {
companion object {

Expand Down Expand Up @@ -79,8 +87,9 @@ open class UpdateRaw(
*/
val UPDATE: TableField<UpdateRawRecord, JSONB?> = createField(DSL.name("update"), SQLDataType.JSONB.nullable(false), this, "")

private constructor(alias: Name, aliased: Table<UpdateRawRecord>?): this(alias, null, null, aliased, null)
private constructor(alias: Name, aliased: Table<UpdateRawRecord>?, parameters: Array<Field<*>?>?): this(alias, null, null, aliased, parameters)
private constructor(alias: Name, aliased: Table<UpdateRawRecord>?): this(alias, null, null, null, aliased, null, null)
private constructor(alias: Name, aliased: Table<UpdateRawRecord>?, parameters: Array<Field<*>?>?): this(alias, null, null, null, aliased, parameters, null)
private constructor(alias: Name, aliased: Table<UpdateRawRecord>?, where: Condition): this(alias, null, null, null, aliased, null, where)

/**
* Create an aliased <code>public.update_raw</code> table reference
Expand All @@ -96,14 +105,12 @@ open class UpdateRaw(
* Create a <code>public.update_raw</code> table reference
*/
constructor(): this(DSL.name("update_raw"), null)

constructor(child: Table<out Record>, key: ForeignKey<out Record, UpdateRawRecord>): this(Internal.createPathAlias(child, key), child, key, UPDATE_RAW, null)
override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC
override fun getIdentity(): Identity<UpdateRawRecord, Long?> = super.getIdentity() as Identity<UpdateRawRecord, Long?>
override fun getPrimaryKey(): UniqueKey<UpdateRawRecord> = UPDATE_RAW_PK
override fun `as`(alias: String): UpdateRaw = UpdateRaw(DSL.name(alias), this)
override fun `as`(alias: Name): UpdateRaw = UpdateRaw(alias, this)
override fun `as`(alias: Table<*>): UpdateRaw = UpdateRaw(alias.getQualifiedName(), this)
override fun `as`(alias: Table<*>): UpdateRaw = UpdateRaw(alias.qualifiedName, this)

/**
* Rename this table
Expand All @@ -118,21 +125,55 @@ open class UpdateRaw(
/**
* Rename this table
*/
override fun rename(name: Table<*>): UpdateRaw = UpdateRaw(name.getQualifiedName(), null)
override fun rename(name: Table<*>): UpdateRaw = UpdateRaw(name.qualifiedName, null)

// -------------------------------------------------------------------------
// Row3 type methods
// -------------------------------------------------------------------------
override fun fieldsRow(): Row3<Long?, LocalDateTime?, JSONB?> = super.fieldsRow() as Row3<Long?, LocalDateTime?, JSONB?>
/**
* Create an inline derived table from this table
*/
override fun where(condition: Condition): UpdateRaw = UpdateRaw(qualifiedName, if (aliased()) this else null, condition)

/**
* Create an inline derived table from this table
*/
override fun where(conditions: Collection<Condition>): UpdateRaw = where(DSL.and(conditions))

/**
* Create an inline derived table from this table
*/
override fun where(vararg conditions: Condition): UpdateRaw = where(DSL.and(*conditions))

/**
* Create an inline derived table from this table
*/
override fun where(condition: Field<Boolean?>): UpdateRaw = where(DSL.condition(condition))

/**
* Create an inline derived table from this table
*/
@PlainSQL override fun where(condition: SQL): UpdateRaw = where(DSL.condition(condition))

/**
* Create an inline derived table from this table
*/
@PlainSQL override fun where(@Stringly.SQL condition: String): UpdateRaw = where(DSL.condition(condition))

/**
* Create an inline derived table from this table
*/
@PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): UpdateRaw = where(DSL.condition(condition, *binds))

/**
* Create an inline derived table from this table
*/
@PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): UpdateRaw = where(DSL.condition(condition, *parts))

/**
* Convenience mapping calling {@link SelectField#convertFrom(Function)}.
* Create an inline derived table from this table
*/
fun <U> mapping(from: (Long?, LocalDateTime?, JSONB?) -> U): SelectField<U> = convertFrom(Records.mapping(from))
override fun whereExists(select: Select<*>): UpdateRaw = where(DSL.exists(select))

/**
* Convenience mapping calling {@link SelectField#convertFrom(Class,
* Function)}.
* Create an inline derived table from this table
*/
fun <U> mapping(toType: Class<U>, from: (Long?, LocalDateTime?, JSONB?) -> U): SelectField<U> = convertFrom(toType, Records.mapping(from))
override fun whereNotExists(select: Select<*>): UpdateRaw = where(DSL.notExists(select))
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,16 @@ import io.heapy.kotbot.database.tables.interfaces.IUpdateRaw

import java.time.LocalDateTime

import org.jooq.Field
import org.jooq.JSONB
import org.jooq.Record1
import org.jooq.Record3
import org.jooq.Row3
import org.jooq.impl.UpdatableRecordImpl


/**
* This class is generated by jOOQ.
*/
@Suppress("UNCHECKED_CAST")
open class UpdateRawRecord private constructor() : UpdatableRecordImpl<UpdateRawRecord>(UpdateRaw.UPDATE_RAW), Record3<Long?, LocalDateTime?, JSONB?>, IUpdateRaw {
open class UpdateRawRecord private constructor() : UpdatableRecordImpl<UpdateRawRecord>(UpdateRaw.UPDATE_RAW), IUpdateRaw {

open override var id: Long?
set(value): Unit = set(0, value)
Expand All @@ -41,52 +38,14 @@ open class UpdateRawRecord private constructor() : UpdatableRecordImpl<UpdateRaw

override fun key(): Record1<Long?> = super.key() as Record1<Long?>

// -------------------------------------------------------------------------
// Record3 type implementation
// -------------------------------------------------------------------------

override fun fieldsRow(): Row3<Long?, LocalDateTime?, JSONB?> = super.fieldsRow() as Row3<Long?, LocalDateTime?, JSONB?>
override fun valuesRow(): Row3<Long?, LocalDateTime?, JSONB?> = super.valuesRow() as Row3<Long?, LocalDateTime?, JSONB?>
override fun field1(): Field<Long?> = UpdateRaw.UPDATE_RAW.ID
override fun field2(): Field<LocalDateTime?> = UpdateRaw.UPDATE_RAW.CREATED
override fun field3(): Field<JSONB?> = UpdateRaw.UPDATE_RAW.UPDATE
override fun component1(): Long? = id
override fun component2(): LocalDateTime = created
override fun component3(): JSONB = update
override fun value1(): Long? = id
override fun value2(): LocalDateTime = created
override fun value3(): JSONB = update

override fun value1(value: Long?): UpdateRawRecord {
set(0, value)
return this
}

override fun value2(value: LocalDateTime?): UpdateRawRecord {
set(1, value)
return this
}

override fun value3(value: JSONB?): UpdateRawRecord {
set(2, value)
return this
}

override fun values(value1: Long?, value2: LocalDateTime?, value3: JSONB?): UpdateRawRecord {
this.value1(value1)
this.value2(value2)
this.value3(value3)
return this
}

// -------------------------------------------------------------------------
// FROM and INTO
// -------------------------------------------------------------------------

fun from(from: IUpdateRaw) {
id = from.id
created = from.created
update = from.update
this.id = from.id
this.created = from.created
this.update = from.update
resetChangedOnNotNull()
}

Expand Down
2 changes: 1 addition & 1 deletion tgkotbot-dataops/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repositories {

dependencies {
implementation(libs.jooq.codegen)
implementation(libs.flyway)
implementation(libs.flyway.database.postgresql)
implementation(libs.postgresql)
implementation(libs.logback)
}

0 comments on commit 524286f

Please sign in to comment.