_User.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.291792265+09:00[Asia/Tokyo]
@org.komapper.core.dsl.metamodel.EntityMetamodelImplementor(com.example.realworldkotlinspringbootjdbc.infra.entity.User::class)
class _User private constructor(table: String = "users", catalog: String = "", schema: String = "", alwaysQuote: Boolean = false, disableSequenceAssignment: Boolean = false, declaration: org.komapper.core.dsl.metamodel.EntityMetamodelDeclaration<_User> = {}) : org.komapper.core.dsl.metamodel.EntityMetamodel<com.example.realworldkotlinspringbootjdbc.infra.entity.User, kotlin.Int, _User> {
    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.User, 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 `email` = org.komapper.core.dsl.metamodel.PropertyDescriptor<com.example.realworldkotlinspringbootjdbc.infra.entity.User, kotlin.String, kotlin.String>(kotlin.String::class, kotlin.String::class, "email", "email", false, false, { it.`email` }, { e, v -> e.copy(`email` = v) }, { it }, { it }, false)
        val `username` = org.komapper.core.dsl.metamodel.PropertyDescriptor<com.example.realworldkotlinspringbootjdbc.infra.entity.User, kotlin.String, kotlin.String>(kotlin.String::class, kotlin.String::class, "username", "username", false, false, { it.`username` }, { e, v -> e.copy(`username` = v) }, { it }, { it }, false)
        val `password` = org.komapper.core.dsl.metamodel.PropertyDescriptor<com.example.realworldkotlinspringbootjdbc.infra.entity.User, kotlin.String, kotlin.String>(kotlin.String::class, kotlin.String::class, "password", "password", false, false, { it.`password` }, { e, v -> e.copy(`password` = v) }, { it }, { it }, false)
        val `createdAt` = org.komapper.core.dsl.metamodel.PropertyDescriptor<com.example.realworldkotlinspringbootjdbc.infra.entity.User, 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.User, 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.User, kotlin.Int, kotlin.Int> by lazy { org.komapper.core.dsl.metamodel.PropertyMetamodelImpl(this, __EntityDescriptor.`id`) }
    val `email`: org.komapper.core.dsl.metamodel.PropertyMetamodel<com.example.realworldkotlinspringbootjdbc.infra.entity.User, kotlin.String, kotlin.String> by lazy { org.komapper.core.dsl.metamodel.PropertyMetamodelImpl(this, __EntityDescriptor.`email`) }
    val `username`: org.komapper.core.dsl.metamodel.PropertyMetamodel<com.example.realworldkotlinspringbootjdbc.infra.entity.User, kotlin.String, kotlin.String> by lazy { org.komapper.core.dsl.metamodel.PropertyMetamodelImpl(this, __EntityDescriptor.`username`) }
    val `password`: org.komapper.core.dsl.metamodel.PropertyMetamodel<com.example.realworldkotlinspringbootjdbc.infra.entity.User, kotlin.String, kotlin.String> by lazy { org.komapper.core.dsl.metamodel.PropertyMetamodelImpl(this, __EntityDescriptor.`password`) }
    val `createdAt`: org.komapper.core.dsl.metamodel.PropertyMetamodel<com.example.realworldkotlinspringbootjdbc.infra.entity.User, 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.User, 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.User::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.User, 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.User, *, *>> = listOf(`id`)
    override fun versionProperty(): org.komapper.core.dsl.metamodel.PropertyMetamodel<com.example.realworldkotlinspringbootjdbc.infra.entity.User, *, *>? = null
    override fun createdAtProperty(): org.komapper.core.dsl.metamodel.PropertyMetamodel<com.example.realworldkotlinspringbootjdbc.infra.entity.User, *, *>? = `createdAt`
    override fun updatedAtProperty(): org.komapper.core.dsl.metamodel.PropertyMetamodel<com.example.realworldkotlinspringbootjdbc.infra.entity.User, *, *>? = `updatedAt`
    override fun properties(): List<org.komapper.core.dsl.metamodel.PropertyMetamodel<com.example.realworldkotlinspringbootjdbc.infra.entity.User, *, *>> = listOf(
        `id`,
        `email`,
        `username`,
        `password`,
        `createdAt`,
        `updatedAt`)
    override fun extractId(e: com.example.realworldkotlinspringbootjdbc.infra.entity.User): 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.User, *, *>, 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.User, *, *>, 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.User, *, *>, 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.User, c: java.time.Clock): com.example.realworldkotlinspringbootjdbc.infra.entity.User = e.copy(`createdAt` = java.time.OffsetDateTime.now(c), `updatedAt` = java.time.OffsetDateTime.now(c))
    override fun preUpdate(e: com.example.realworldkotlinspringbootjdbc.infra.entity.User, c: java.time.Clock): com.example.realworldkotlinspringbootjdbc.infra.entity.User = e.copy(`updatedAt` = java.time.OffsetDateTime.now(c))
    override fun postUpdate(e: com.example.realworldkotlinspringbootjdbc.infra.entity.User): com.example.realworldkotlinspringbootjdbc.infra.entity.User = e
    override fun newEntity(m: Map<org.komapper.core.dsl.metamodel.PropertyMetamodel<*, *, *>, Any?>) = com.example.realworldkotlinspringbootjdbc.infra.entity.User(
        `id` = m[this.`id`] as kotlin.Int,
        `email` = m[this.`email`] as kotlin.String,
        `username` = m[this.`username`] as kotlin.String,
        `password` = m[this.`password`] 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<_User>) = _User(table, catalog, schema, alwaysQuote, disableSequenceAssignment, declaration)
    fun clone(table: String = "users", catalog: String = "", schema: String = "", alwaysQuote: Boolean = false, disableSequenceAssignment: Boolean = false, declaration: org.komapper.core.dsl.metamodel.EntityMetamodelDeclaration<_User> = {}) = _User(table, catalog, schema, alwaysQuote, disableSequenceAssignment, declaration)
    companion object {
        init {
            org.komapper.core.dsl.metamodel.checkMetamodelVersion("com.example.realworldkotlinspringbootjdbc.infra.entity._User", 1)
        }
        val `user` = _User()
    }
}

val org.komapper.core.dsl.Meta.`user` get() = _User.`user`