com.dbobjekts.api.TableRowData.kt Maven / Gradle / Ivy
package com.dbobjekts.api
import com.dbobjekts.metadata.column.IsGeneratedPrimaryKey
import com.dbobjekts.statement.WriteQueryAccessors
import com.dbobjekts.statement.insert.InsertBuilderBase
import com.dbobjekts.statement.update.UpdateBuilderBase
abstract class TableRowData(
internal val writeAccessors: WriteQueryAccessors
) {
abstract val primaryKeys: List>
internal fun hasGeneratedPrimaryKey(): Boolean = primaryKeys.any { it.first is IsGeneratedPrimaryKey }
internal fun getAutoGeneratedPkValue(): Long = if (hasGeneratedPrimaryKey()) primaryKeys.first().second.toString().toLong() else 0
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy