com.sxtanna.database.task.builder.UpdateBuilder.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Kuery Show documentation
Show all versions of Kuery Show documentation
MySQL Kotlin wrapper based on HikariCP
package com.sxtanna.database.task.builder
import com.sxtanna.database.type.base.SqlObject
import kotlin.reflect.KClass
data class UpdateBuilder(val clazz : KClass, val table : String) : WhereBuilder>() {
val ignoring = mutableSetOf()
fun ignore(vararg column : String) : UpdateBuilder {
ignoring.addAll(column.map { it.toLowerCase() })
return this
}
companion object Update {
@JvmSynthetic
inline fun where(table : String = T::class.simpleName!!) = UpdateBuilder(T::class, table)
@JvmOverloads
fun where(clazz : Class, table : String = clazz.simpleName!!) = UpdateBuilder(clazz.kotlin, table)
}
}