blob: a87fb3b1f29654bb7ee0b9d8db1d4d292d0f53ba [file] [log] [blame]
import androidx.room.RoomDatabase
import androidx.room.util.getColumnIndexOrThrow
import androidx.room.util.getLastInsertedRowId
import androidx.room.util.performBlocking
import androidx.sqlite.SQLiteStatement
import javax.`annotation`.processing.Generated
import kotlin.Int
import kotlin.Long
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.reflect.KClass
@Generated(value = ["androidx.room.RoomProcessor"])
@Suppress(names = ["UNCHECKED_CAST", "DEPRECATION", "REDUNDANT_PROJECTION", "REMOVAL"])
public class MyDao_Impl(
__db: RoomDatabase,
) : MyDao {
private val __db: RoomDatabase
init {
this.__db = __db
}
public override fun getEntity(id: Long): MyEntity {
val _sql: String = "SELECT * FROM MyEntity WHERE pk = ?"
return performBlocking(__db, true, false) { _connection ->
val _stmt: SQLiteStatement = _connection.prepare(_sql)
try {
var _argIndex: Int = 1
_stmt.bindLong(_argIndex, id)
val _cursorIndexOfPk: Int = getColumnIndexOrThrow(_stmt, "pk")
val _result: MyEntity
if (_stmt.step()) {
val _tmpPk: Long
_tmpPk = _stmt.getLong(_cursorIndexOfPk)
_result = MyEntity(_tmpPk)
} else {
error("The query result was empty, but expected a single row to return a NON-NULL object of type <MyEntity>.")
}
_result
} finally {
_stmt.close()
}
}
}
public override fun insertEntity(id: Long): Long {
val _sql: String = "INSERT INTO MyEntity (pk) VALUES (?)"
return performBlocking(__db, false, true) { _connection ->
val _stmt: SQLiteStatement = _connection.prepare(_sql)
try {
var _argIndex: Int = 1
_stmt.bindLong(_argIndex, id)
_stmt.step()
getLastInsertedRowId(_connection)
} finally {
_stmt.close()
}
}
}
public companion object {
public fun getRequiredConverters(): List<KClass<*>> = emptyList()
}
}