<lambda>null1 import androidx.room.EntityInsertAdapter
2 import androidx.room.RoomDatabase
3 import androidx.room.util.getColumnIndexOrThrow
4 import androidx.room.util.performBlocking
5 import androidx.sqlite.SQLiteStatement
6 import javax.`annotation`.processing.Generated
7 import kotlin.Boolean
8 import kotlin.Int
9 import kotlin.String
10 import kotlin.Suppress
11 import kotlin.Unit
12 import kotlin.collections.List
13 import kotlin.reflect.KClass
14
15 @Generated(value = ["androidx.room.RoomProcessor"])
16 @Suppress(names = ["UNCHECKED_CAST", "DEPRECATION", "REDUNDANT_PROJECTION", "REMOVAL"])
17 public class MyDao_Impl(
18 __db: RoomDatabase,
19 ) : MyDao {
20 private val __db: RoomDatabase
21
22 private val __insertAdapterOfMyEntity: EntityInsertAdapter<MyEntity>
23 init {
24 this.__db = __db
25 this.__insertAdapterOfMyEntity = object : EntityInsertAdapter<MyEntity>() {
26 protected override fun createQuery(): String = "INSERT OR ABORT INTO `MyEntity` (`pk`,`boolean`,`nullableBoolean`) VALUES (?,?,?)"
27
28 protected override fun bind(statement: SQLiteStatement, entity: MyEntity) {
29 statement.bindLong(1, entity.pk.toLong())
30 val _tmp: Int = if (entity.boolean) 1 else 0
31 statement.bindLong(2, _tmp.toLong())
32 val _tmpNullableBoolean: Boolean? = entity.nullableBoolean
33 val _tmp_1: Int? = _tmpNullableBoolean?.let { if (it) 1 else 0 }
34 if (_tmp_1 == null) {
35 statement.bindNull(3)
36 } else {
37 statement.bindLong(3, _tmp_1.toLong())
38 }
39 }
40 }
41 }
42
43 public override fun addEntity(item: MyEntity): Unit = performBlocking(__db, false, true) { _connection ->
44 __insertAdapterOfMyEntity.insert(_connection, item)
45 }
46
47 public override fun getEntity(): MyEntity {
48 val _sql: String = "SELECT * FROM MyEntity"
49 return performBlocking(__db, true, false) { _connection ->
50 val _stmt: SQLiteStatement = _connection.prepare(_sql)
51 try {
52 val _columnIndexOfPk: Int = getColumnIndexOrThrow(_stmt, "pk")
53 val _columnIndexOfBoolean: Int = getColumnIndexOrThrow(_stmt, "boolean")
54 val _columnIndexOfNullableBoolean: Int = getColumnIndexOrThrow(_stmt, "nullableBoolean")
55 val _result: MyEntity
56 if (_stmt.step()) {
57 val _tmpPk: Int
58 _tmpPk = _stmt.getLong(_columnIndexOfPk).toInt()
59 val _tmpBoolean: Boolean
60 val _tmp: Int
61 _tmp = _stmt.getLong(_columnIndexOfBoolean).toInt()
62 _tmpBoolean = _tmp != 0
63 val _tmpNullableBoolean: Boolean?
64 val _tmp_1: Int?
65 if (_stmt.isNull(_columnIndexOfNullableBoolean)) {
66 _tmp_1 = null
67 } else {
68 _tmp_1 = _stmt.getLong(_columnIndexOfNullableBoolean).toInt()
69 }
70 _tmpNullableBoolean = _tmp_1?.let { it != 0 }
71 _result = MyEntity(_tmpPk,_tmpBoolean,_tmpNullableBoolean)
72 } else {
73 error("The query result was empty, but expected a single row to return a NON-NULL object of type <MyEntity>.")
74 }
75 _result
76 } finally {
77 _stmt.close()
78 }
79 }
80 }
81
82 public companion object {
83 public fun getRequiredConverters(): List<KClass<*>> = emptyList()
84 }
85 }
86