<lambda>null1 import androidx.room.RoomDatabase
2 import androidx.room.RoomRawQuery
3 import androidx.room.RoomSQLiteQuery
4 import androidx.room.coroutines.createFlow
5 import androidx.room.util.getColumnIndex
6 import androidx.room.util.performBlocking
7 import androidx.sqlite.SQLiteStatement
8 import androidx.sqlite.db.SupportSQLiteQuery
9 import javax.`annotation`.processing.Generated
10 import kotlin.Double
11 import kotlin.Float
12 import kotlin.Int
13 import kotlin.Long
14 import kotlin.String
15 import kotlin.Suppress
16 import kotlin.collections.List
17 import kotlin.reflect.KClass
18 import kotlinx.coroutines.flow.Flow
19
20 @Generated(value = ["androidx.room.RoomProcessor"])
21 @Suppress(names = ["UNCHECKED_CAST", "DEPRECATION", "REDUNDANT_PROJECTION", "REMOVAL"])
22 public class MyDao_Impl(
23 __db: RoomDatabase,
24 ) : MyDao {
25 private val __db: RoomDatabase
26 init {
27 this.__db = __db
28 }
29
30 public override fun getEntitySupport(sql: SupportSQLiteQuery): MyEntity {
31 val _rawQuery: RoomRawQuery = RoomSQLiteQuery.copyFrom(sql).toRoomRawQuery()
32 val _sql: String = _rawQuery.sql
33 return performBlocking(__db, true, false) { _connection ->
34 val _stmt: SQLiteStatement = _connection.prepare(_sql)
35 try {
36 _rawQuery.getBindingFunction().invoke(_stmt)
37 val _result: MyEntity
38 if (_stmt.step()) {
39 _result = __entityStatementConverter_MyEntity(_stmt)
40 } else {
41 error("The query result was empty, but expected a single row to return a NON-NULL object of type <MyEntity>.")
42 }
43 _result
44 } finally {
45 _stmt.close()
46 }
47 }
48 }
49
50 public override fun getNullableEntitySupport(sql: SupportSQLiteQuery): MyEntity? {
51 val _rawQuery: RoomRawQuery = RoomSQLiteQuery.copyFrom(sql).toRoomRawQuery()
52 val _sql: String = _rawQuery.sql
53 return performBlocking(__db, true, false) { _connection ->
54 val _stmt: SQLiteStatement = _connection.prepare(_sql)
55 try {
56 _rawQuery.getBindingFunction().invoke(_stmt)
57 val _result: MyEntity?
58 if (_stmt.step()) {
59 _result = __entityStatementConverter_MyEntity(_stmt)
60 } else {
61 _result = null
62 }
63 _result
64 } finally {
65 _stmt.close()
66 }
67 }
68 }
69
70 public override fun getEntitySupportFlow(sql: SupportSQLiteQuery): Flow<MyEntity> {
71 val _rawQuery: RoomRawQuery = RoomSQLiteQuery.copyFrom(sql).toRoomRawQuery()
72 val _sql: String = _rawQuery.sql
73 return createFlow(__db, false, arrayOf("MyEntity")) { _connection ->
74 val _stmt: SQLiteStatement = _connection.prepare(_sql)
75 try {
76 _rawQuery.getBindingFunction().invoke(_stmt)
77 val _result: MyEntity
78 if (_stmt.step()) {
79 _result = __entityStatementConverter_MyEntity(_stmt)
80 } else {
81 error("The query result was empty, but expected a single row to return a NON-NULL object of type <MyEntity>.")
82 }
83 _result
84 } finally {
85 _stmt.close()
86 }
87 }
88 }
89
90 public override fun getEntity(query: RoomRawQuery): MyEntity {
91 val _sql: String = query.sql
92 return performBlocking(__db, true, false) { _connection ->
93 val _stmt: SQLiteStatement = _connection.prepare(_sql)
94 try {
95 query.getBindingFunction().invoke(_stmt)
96 val _result: MyEntity
97 if (_stmt.step()) {
98 _result = __entityStatementConverter_MyEntity(_stmt)
99 } else {
100 error("The query result was empty, but expected a single row to return a NON-NULL object of type <MyEntity>.")
101 }
102 _result
103 } finally {
104 _stmt.close()
105 }
106 }
107 }
108
109 public override fun getNullableEntity(query: RoomRawQuery): MyEntity? {
110 val _sql: String = query.sql
111 return performBlocking(__db, true, false) { _connection ->
112 val _stmt: SQLiteStatement = _connection.prepare(_sql)
113 try {
114 query.getBindingFunction().invoke(_stmt)
115 val _result: MyEntity?
116 if (_stmt.step()) {
117 _result = __entityStatementConverter_MyEntity(_stmt)
118 } else {
119 _result = null
120 }
121 _result
122 } finally {
123 _stmt.close()
124 }
125 }
126 }
127
128 public override fun getEntityFlow(query: RoomRawQuery): Flow<MyEntity> {
129 val _sql: String = query.sql
130 return createFlow(__db, false, arrayOf("MyEntity")) { _connection ->
131 val _stmt: SQLiteStatement = _connection.prepare(_sql)
132 try {
133 query.getBindingFunction().invoke(_stmt)
134 val _result: MyEntity
135 if (_stmt.step()) {
136 _result = __entityStatementConverter_MyEntity(_stmt)
137 } else {
138 error("The query result was empty, but expected a single row to return a NON-NULL object of type <MyEntity>.")
139 }
140 _result
141 } finally {
142 _stmt.close()
143 }
144 }
145 }
146
147 private fun __entityStatementConverter_MyEntity(statement: SQLiteStatement): MyEntity {
148 val _entity: MyEntity
149 val _columnIndexOfPk: Int = getColumnIndex(statement, "pk")
150 val _columnIndexOfDoubleColumn: Int = getColumnIndex(statement, "doubleColumn")
151 val _columnIndexOfFloatColumn: Int = getColumnIndex(statement, "floatColumn")
152 val _tmpPk: Long
153 if (_columnIndexOfPk == -1) {
154 _tmpPk = 0
155 } else {
156 _tmpPk = statement.getLong(_columnIndexOfPk)
157 }
158 val _tmpDoubleColumn: Double
159 if (_columnIndexOfDoubleColumn == -1) {
160 _tmpDoubleColumn = 0.0
161 } else {
162 _tmpDoubleColumn = statement.getDouble(_columnIndexOfDoubleColumn)
163 }
164 val _tmpFloatColumn: Float
165 if (_columnIndexOfFloatColumn == -1) {
166 _tmpFloatColumn = 0f
167 } else {
168 _tmpFloatColumn = statement.getDouble(_columnIndexOfFloatColumn).toFloat()
169 }
170 _entity = MyEntity(_tmpPk,_tmpDoubleColumn,_tmpFloatColumn)
171 return _entity
172 }
173
174 public companion object {
175 public fun getRequiredConverters(): List<KClass<*>> = emptyList()
176 }
177 }
178