<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.Int
8 import kotlin.Long
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` (`mValue`,`mNullableValue`) VALUES (?,?)"
27
28 protected override fun bind(statement: SQLiteStatement, entity: MyEntity) {
29 statement.bindLong(1, entity.getValue())
30 val _tmpMNullableValue: String? = entity.getNullableValue()
31 if (_tmpMNullableValue == null) {
32 statement.bindNull(2)
33 } else {
34 statement.bindText(2, _tmpMNullableValue)
35 }
36 }
37 }
38 }
39
40 public override fun addEntity(item: MyEntity): Unit = performBlocking(__db, false, true) { _connection ->
41 __insertAdapterOfMyEntity.insert(_connection, item)
42 }
43
44 public override fun getEntity(): MyEntity {
45 val _sql: String = "SELECT * FROM MyEntity"
46 return performBlocking(__db, true, false) { _connection ->
47 val _stmt: SQLiteStatement = _connection.prepare(_sql)
48 try {
49 val _columnIndexOfMValue: Int = getColumnIndexOrThrow(_stmt, "mValue")
50 val _columnIndexOfMNullableValue: Int = getColumnIndexOrThrow(_stmt, "mNullableValue")
51 val _result: MyEntity
52 if (_stmt.step()) {
53 _result = MyEntity()
54 val _tmpMValue: Long
55 _tmpMValue = _stmt.getLong(_columnIndexOfMValue)
56 _result.setValue(_tmpMValue)
57 val _tmpMNullableValue: String?
58 if (_stmt.isNull(_columnIndexOfMNullableValue)) {
59 _tmpMNullableValue = null
60 } else {
61 _tmpMNullableValue = _stmt.getText(_columnIndexOfMNullableValue)
62 }
63 _result.setNullableValue(_tmpMNullableValue)
64 } else {
65 error("The query result was empty, but expected a single row to return a NON-NULL object of type <MyEntity>.")
66 }
67 _result
68 } finally {
69 _stmt.close()
70 }
71 }
72 }
73
74 public companion object {
75 public fun getRequiredConverters(): List<KClass<*>> = emptyList()
76 }
77 }
78