_Profile.kt
@file:Suppress("ClassName", "PrivatePropertyName", "UNUSED_PARAMETER", "unused", "RemoveRedundantQualifierName", "MemberVisibilityCanBePrivate", "RedundantNullableReturnType", "USELESS_CAST", "UNCHECKED_CAST", "RemoveRedundantBackticks")
package com.example.realworldkotlinspringbootjdbc.infra.entity
// generated at 2023-02-23T12:02:13.221104294+09:00[Asia/Tokyo]
@org.komapper.core.dsl.metamodel.EntityMetamodelImplementor(com.example.realworldkotlinspringbootjdbc.infra.entity.Profile::class)
class _Profile private constructor(table: String = "profiles", catalog: String = "", schema: String = "", alwaysQuote: Boolean = false, disableSequenceAssignment: Boolean = false, declaration: org.komapper.core.dsl.metamodel.EntityMetamodelDeclaration<_Profile> = {}) : org.komapper.core.dsl.metamodel.EntityMetamodel<com.example.realworldkotlinspringbootjdbc.infra.entity.Profile, kotlin.Int, _Profile> {
private val __tableName = table
private val __catalogName = catalog
private val __schemaName = schema
private val __alwaysQuote = alwaysQuote
private val __disableSequenceAssignment = disableSequenceAssignment
private val __declaration = declaration
private object __EntityDescriptor {
val `id` = org.komapper.core.dsl.metamodel.PropertyDescriptor<com.example.realworldkotlinspringbootjdbc.infra.entity.Profile, kotlin.Int, kotlin.Int>(kotlin.Int::class, kotlin.Int::class, "id", "id", false, false, { it.`id` }, { e, v -> e.copy(`id` = v) }, { it }, { it }, false)
val `userId` = org.komapper.core.dsl.metamodel.PropertyDescriptor<com.example.realworldkotlinspringbootjdbc.infra.entity.Profile, kotlin.Int, kotlin.Int>(kotlin.Int::class, kotlin.Int::class, "userId", "user_id", false, false, { it.`userId` }, { e, v -> e.copy(`userId` = v) }, { it }, { it }, false)
val `bio` = org.komapper.core.dsl.metamodel.PropertyDescriptor<com.example.realworldkotlinspringbootjdbc.infra.entity.Profile, kotlin.String, kotlin.String>(kotlin.String::class, kotlin.String::class, "bio", "bio", false, false, { it.`bio` }, { e, v -> e.copy(`bio` = v) }, { it }, { it }, false)
val `image` = org.komapper.core.dsl.metamodel.PropertyDescriptor<com.example.realworldkotlinspringbootjdbc.infra.entity.Profile, kotlin.String, kotlin.String>(kotlin.String::class, kotlin.String::class, "image", "image", false, false, { it.`image` }, { e, v -> e.copy(`image` = v) }, { it }, { it }, false)
val `createdAt` = org.komapper.core.dsl.metamodel.PropertyDescriptor<com.example.realworldkotlinspringbootjdbc.infra.entity.Profile, java.time.OffsetDateTime, java.time.OffsetDateTime>(java.time.OffsetDateTime::class, java.time.OffsetDateTime::class, "createdAt", "created_at", false, false, { it.`createdAt` }, { e, v -> e.copy(`createdAt` = v) }, { it }, { it }, false)
val `updatedAt` = org.komapper.core.dsl.metamodel.PropertyDescriptor<com.example.realworldkotlinspringbootjdbc.infra.entity.Profile, java.time.OffsetDateTime, java.time.OffsetDateTime>(java.time.OffsetDateTime::class, java.time.OffsetDateTime::class, "updatedAt", "updated_at", false, false, { it.`updatedAt` }, { e, v -> e.copy(`updatedAt` = v) }, { it }, { it }, false)
}
val `id`: org.komapper.core.dsl.metamodel.PropertyMetamodel<com.example.realworldkotlinspringbootjdbc.infra.entity.Profile, kotlin.Int, kotlin.Int> by lazy { org.komapper.core.dsl.metamodel.PropertyMetamodelImpl(this, __EntityDescriptor.`id`) }
val `userId`: org.komapper.core.dsl.metamodel.PropertyMetamodel<com.example.realworldkotlinspringbootjdbc.infra.entity.Profile, kotlin.Int, kotlin.Int> by lazy { org.komapper.core.dsl.metamodel.PropertyMetamodelImpl(this, __EntityDescriptor.`userId`) }
val `bio`: org.komapper.core.dsl.metamodel.PropertyMetamodel<com.example.realworldkotlinspringbootjdbc.infra.entity.Profile, kotlin.String, kotlin.String> by lazy { org.komapper.core.dsl.metamodel.PropertyMetamodelImpl(this, __EntityDescriptor.`bio`) }
val `image`: org.komapper.core.dsl.metamodel.PropertyMetamodel<com.example.realworldkotlinspringbootjdbc.infra.entity.Profile, kotlin.String, kotlin.String> by lazy { org.komapper.core.dsl.metamodel.PropertyMetamodelImpl(this, __EntityDescriptor.`image`) }
val `createdAt`: org.komapper.core.dsl.metamodel.PropertyMetamodel<com.example.realworldkotlinspringbootjdbc.infra.entity.Profile, java.time.OffsetDateTime, java.time.OffsetDateTime> by lazy { org.komapper.core.dsl.metamodel.PropertyMetamodelImpl(this, __EntityDescriptor.`createdAt`) }
val `updatedAt`: org.komapper.core.dsl.metamodel.PropertyMetamodel<com.example.realworldkotlinspringbootjdbc.infra.entity.Profile, java.time.OffsetDateTime, java.time.OffsetDateTime> by lazy { org.komapper.core.dsl.metamodel.PropertyMetamodelImpl(this, __EntityDescriptor.`updatedAt`) }
override fun klass() = com.example.realworldkotlinspringbootjdbc.infra.entity.Profile::class
override fun tableName() = __tableName
override fun catalogName() = __catalogName
override fun schemaName() = __schemaName
override fun alwaysQuote() = __alwaysQuote
override fun disableSequenceAssignment() = __disableSequenceAssignment
override fun declaration() = __declaration
override fun idGenerator(): org.komapper.core.dsl.metamodel.IdGenerator<com.example.realworldkotlinspringbootjdbc.infra.entity.Profile, kotlin.Int>? = org.komapper.core.dsl.metamodel.IdGenerator.AutoIncrement(`id`)
override fun idProperties(): List<org.komapper.core.dsl.metamodel.PropertyMetamodel<com.example.realworldkotlinspringbootjdbc.infra.entity.Profile, *, *>> = listOf(`id`)
override fun versionProperty(): org.komapper.core.dsl.metamodel.PropertyMetamodel<com.example.realworldkotlinspringbootjdbc.infra.entity.Profile, *, *>? = null
override fun createdAtProperty(): org.komapper.core.dsl.metamodel.PropertyMetamodel<com.example.realworldkotlinspringbootjdbc.infra.entity.Profile, *, *>? = `createdAt`
override fun updatedAtProperty(): org.komapper.core.dsl.metamodel.PropertyMetamodel<com.example.realworldkotlinspringbootjdbc.infra.entity.Profile, *, *>? = `updatedAt`
override fun properties(): List<org.komapper.core.dsl.metamodel.PropertyMetamodel<com.example.realworldkotlinspringbootjdbc.infra.entity.Profile, *, *>> = listOf(
`id`,
`userId`,
`bio`,
`image`,
`createdAt`,
`updatedAt`)
override fun extractId(e: com.example.realworldkotlinspringbootjdbc.infra.entity.Profile): kotlin.Int = e.`id`
override fun convertToId(generatedKey: Long): kotlin.Int? = this.`id`.wrap(generatedKey.toInt())
override fun versionAssignment(): Pair<org.komapper.core.dsl.metamodel.PropertyMetamodel<com.example.realworldkotlinspringbootjdbc.infra.entity.Profile, *, *>, org.komapper.core.dsl.expression.Operand>? = null
override fun createdAtAssignment(c: java.time.Clock): Pair<org.komapper.core.dsl.metamodel.PropertyMetamodel<com.example.realworldkotlinspringbootjdbc.infra.entity.Profile, *, *>, org.komapper.core.dsl.expression.Operand>? = `createdAt` to org.komapper.core.dsl.expression.Operand.Argument(`createdAt`, java.time.OffsetDateTime.now(c))
override fun updatedAtAssignment(c: java.time.Clock): Pair<org.komapper.core.dsl.metamodel.PropertyMetamodel<com.example.realworldkotlinspringbootjdbc.infra.entity.Profile, *, *>, org.komapper.core.dsl.expression.Operand>? = `updatedAt` to org.komapper.core.dsl.expression.Operand.Argument(`updatedAt`, java.time.OffsetDateTime.now(c))
override fun preInsert(e: com.example.realworldkotlinspringbootjdbc.infra.entity.Profile, c: java.time.Clock): com.example.realworldkotlinspringbootjdbc.infra.entity.Profile = e.copy(`createdAt` = java.time.OffsetDateTime.now(c), `updatedAt` = java.time.OffsetDateTime.now(c))
override fun preUpdate(e: com.example.realworldkotlinspringbootjdbc.infra.entity.Profile, c: java.time.Clock): com.example.realworldkotlinspringbootjdbc.infra.entity.Profile = e.copy(`updatedAt` = java.time.OffsetDateTime.now(c))
override fun postUpdate(e: com.example.realworldkotlinspringbootjdbc.infra.entity.Profile): com.example.realworldkotlinspringbootjdbc.infra.entity.Profile = e
override fun newEntity(m: Map<org.komapper.core.dsl.metamodel.PropertyMetamodel<*, *, *>, Any?>) = com.example.realworldkotlinspringbootjdbc.infra.entity.Profile(
`id` = m[this.`id`] as kotlin.Int,
`userId` = m[this.`userId`] as kotlin.Int,
`bio` = m[this.`bio`] as kotlin.String,
`image` = m[this.`image`] as kotlin.String,
`createdAt` = m[this.`createdAt`] as java.time.OffsetDateTime,
`updatedAt` = m[this.`updatedAt`] as java.time.OffsetDateTime)
override fun newMetamodel(table: String, catalog: String, schema: String, alwaysQuote: Boolean, disableSequenceAssignment: Boolean, declaration: org.komapper.core.dsl.metamodel.EntityMetamodelDeclaration<_Profile>) = _Profile(table, catalog, schema, alwaysQuote, disableSequenceAssignment, declaration)
fun clone(table: String = "profiles", catalog: String = "", schema: String = "", alwaysQuote: Boolean = false, disableSequenceAssignment: Boolean = false, declaration: org.komapper.core.dsl.metamodel.EntityMetamodelDeclaration<_Profile> = {}) = _Profile(table, catalog, schema, alwaysQuote, disableSequenceAssignment, declaration)
companion object {
init {
org.komapper.core.dsl.metamodel.checkMetamodelVersion("com.example.realworldkotlinspringbootjdbc.infra.entity._Profile", 1)
}
val `profile` = _Profile()
}
}
val org.komapper.core.dsl.Meta.`profile` get() = _Profile.`profile`