<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.String
9 import kotlin.Suppress
10 import kotlin.Unit
11 import kotlin.collections.List
12 import kotlin.reflect.KClass
13 
14 @Generated(value = ["androidx.room.RoomProcessor"])
15 @Suppress(names = ["UNCHECKED_CAST", "DEPRECATION", "REDUNDANT_PROJECTION", "REMOVAL"])
16 public class MyDao_Impl(
17   __db: RoomDatabase,
18 ) : MyDao {
19   private val __db: RoomDatabase
20 
21   private val __insertAdapterOfMyEntity: EntityInsertAdapter<MyEntity>
22   init {
23     this.__db = __db
24     this.__insertAdapterOfMyEntity = object : EntityInsertAdapter<MyEntity>() {
25       protected override fun createQuery(): String = "INSERT OR ABORT INTO `MyEntity` (`string`,`nullableString`) VALUES (?,?)"
26 
27       protected override fun bind(statement: SQLiteStatement, entity: MyEntity) {
28         statement.bindText(1, entity.string)
29         val _tmpNullableString: String? = entity.nullableString
30         if (_tmpNullableString == null) {
31           statement.bindNull(2)
32         } else {
33           statement.bindText(2, _tmpNullableString)
34         }
35       }
36     }
37   }
38 
39   public override fun addEntity(item: MyEntity): Unit = performBlocking(__db, false, true) { _connection ->
40     __insertAdapterOfMyEntity.insert(_connection, item)
41   }
42 
43   public override fun getEntity(): MyEntity {
44     val _sql: String = "SELECT * FROM MyEntity"
45     return performBlocking(__db, true, false) { _connection ->
46       val _stmt: SQLiteStatement = _connection.prepare(_sql)
47       try {
48         val _columnIndexOfString: Int = getColumnIndexOrThrow(_stmt, "string")
49         val _columnIndexOfNullableString: Int = getColumnIndexOrThrow(_stmt, "nullableString")
50         val _result: MyEntity
51         if (_stmt.step()) {
52           val _tmpString: String
53           _tmpString = _stmt.getText(_columnIndexOfString)
54           val _tmpNullableString: String?
55           if (_stmt.isNull(_columnIndexOfNullableString)) {
56             _tmpNullableString = null
57           } else {
58             _tmpNullableString = _stmt.getText(_columnIndexOfNullableString)
59           }
60           _result = MyEntity(_tmpString,_tmpNullableString)
61         } else {
62           error("The query result was empty, but expected a single row to return a NON-NULL object of type <MyEntity>.")
63         }
64         _result
65       } finally {
66         _stmt.close()
67       }
68     }
69   }
70 
71   public companion object {
72     public fun getRequiredConverters(): List<KClass<*>> = emptyList()
73   }
74 }
75