<lambda>null1 import androidx.room.RoomDatabase
2 import androidx.room.coroutines.createFlow
3 import androidx.room.util.appendPlaceholders
4 import androidx.room.util.getColumnIndexOrThrow
5 import androidx.room.util.getLastInsertedRowId
6 import androidx.room.util.getTotalChangedRows
7 import androidx.room.util.performSuspending
8 import androidx.sqlite.SQLiteStatement
9 import javax.`annotation`.processing.Generated
10 import kotlin.Int
11 import kotlin.Long
12 import kotlin.String
13 import kotlin.Suppress
14 import kotlin.collections.List
15 import kotlin.collections.MutableList
16 import kotlin.collections.mutableListOf
17 import kotlin.reflect.KClass
18 import kotlin.text.StringBuilder
19 import kotlinx.coroutines.flow.Flow
20 
21 @Generated(value = ["androidx.room.RoomProcessor"])
22 @Suppress(names = ["UNCHECKED_CAST", "DEPRECATION", "REDUNDANT_PROJECTION", "REMOVAL"])
23 public class MyDao_Impl(
24   __db: RoomDatabase,
25 ) : MyDao {
26   private val __db: RoomDatabase
27   init {
28     this.__db = __db
29   }
30 
31   public override fun getFlow(vararg arg: String?): Flow<MyEntity> {
32     val _stringBuilder: StringBuilder = StringBuilder()
33     _stringBuilder.append("SELECT * FROM MyEntity WHERE pk IN (")
34     val _inputSize: Int = arg.size
35     appendPlaceholders(_stringBuilder, _inputSize)
36     _stringBuilder.append(")")
37     val _sql: String = _stringBuilder.toString()
38     return createFlow(__db, false, arrayOf("MyEntity")) { _connection ->
39       val _stmt: SQLiteStatement = _connection.prepare(_sql)
40       try {
41         var _argIndex: Int = 1
42         for (_item: String? in arg) {
43           if (_item == null) {
44             _stmt.bindNull(_argIndex)
45           } else {
46             _stmt.bindText(_argIndex, _item)
47           }
48           _argIndex++
49         }
50         val _columnIndexOfPk: Int = getColumnIndexOrThrow(_stmt, "pk")
51         val _columnIndexOfOther: Int = getColumnIndexOrThrow(_stmt, "other")
52         val _result: MyEntity
53         if (_stmt.step()) {
54           val _tmpPk: Int
55           _tmpPk = _stmt.getLong(_columnIndexOfPk).toInt()
56           val _tmpOther: String
57           _tmpOther = _stmt.getText(_columnIndexOfOther)
58           _result = MyEntity(_tmpPk,_tmpOther)
59         } else {
60           error("The query result was empty, but expected a single row to return a NON-NULL object of type <MyEntity>.")
61         }
62         _result
63       } finally {
64         _stmt.close()
65       }
66     }
67   }
68 
69   public override fun getFlowNullable(vararg arg: String?): Flow<MyEntity?> {
70     val _stringBuilder: StringBuilder = StringBuilder()
71     _stringBuilder.append("SELECT * FROM MyEntity WHERE pk IN (")
72     val _inputSize: Int = arg.size
73     appendPlaceholders(_stringBuilder, _inputSize)
74     _stringBuilder.append(")")
75     val _sql: String = _stringBuilder.toString()
76     return createFlow(__db, false, arrayOf("MyEntity")) { _connection ->
77       val _stmt: SQLiteStatement = _connection.prepare(_sql)
78       try {
79         var _argIndex: Int = 1
80         for (_item: String? in arg) {
81           if (_item == null) {
82             _stmt.bindNull(_argIndex)
83           } else {
84             _stmt.bindText(_argIndex, _item)
85           }
86           _argIndex++
87         }
88         val _columnIndexOfPk: Int = getColumnIndexOrThrow(_stmt, "pk")
89         val _columnIndexOfOther: Int = getColumnIndexOrThrow(_stmt, "other")
90         val _result: MyEntity?
91         if (_stmt.step()) {
92           val _tmpPk: Int
93           _tmpPk = _stmt.getLong(_columnIndexOfPk).toInt()
94           val _tmpOther: String
95           _tmpOther = _stmt.getText(_columnIndexOfOther)
96           _result = MyEntity(_tmpPk,_tmpOther)
97         } else {
98           _result = null
99         }
100         _result
101       } finally {
102         _stmt.close()
103       }
104     }
105   }
106 
107   public override suspend fun getSuspendList(vararg arg: String?): List<MyEntity> {
108     val _stringBuilder: StringBuilder = StringBuilder()
109     _stringBuilder.append("SELECT * FROM MyEntity WHERE pk IN (")
110     val _inputSize: Int = arg.size
111     appendPlaceholders(_stringBuilder, _inputSize)
112     _stringBuilder.append(")")
113     val _sql: String = _stringBuilder.toString()
114     return performSuspending(__db, true, false) { _connection ->
115       val _stmt: SQLiteStatement = _connection.prepare(_sql)
116       try {
117         var _argIndex: Int = 1
118         for (_item: String? in arg) {
119           if (_item == null) {
120             _stmt.bindNull(_argIndex)
121           } else {
122             _stmt.bindText(_argIndex, _item)
123           }
124           _argIndex++
125         }
126         val _columnIndexOfPk: Int = getColumnIndexOrThrow(_stmt, "pk")
127         val _columnIndexOfOther: Int = getColumnIndexOrThrow(_stmt, "other")
128         val _result: MutableList<MyEntity> = mutableListOf()
129         while (_stmt.step()) {
130           val _item_1: MyEntity
131           val _tmpPk: Int
132           _tmpPk = _stmt.getLong(_columnIndexOfPk).toInt()
133           val _tmpOther: String
134           _tmpOther = _stmt.getText(_columnIndexOfOther)
135           _item_1 = MyEntity(_tmpPk,_tmpOther)
136           _result.add(_item_1)
137         }
138         _result
139       } finally {
140         _stmt.close()
141       }
142     }
143   }
144 
145   public override suspend fun getCount(): Int {
146     val _sql: String = "SELECT count(*) FROM MyEntity"
147     return performSuspending(__db, true, false) { _connection ->
148       val _stmt: SQLiteStatement = _connection.prepare(_sql)
149       try {
150         val _result: Int
151         if (_stmt.step()) {
152           val _tmp: Int
153           _tmp = _stmt.getLong(0).toInt()
154           _result = _tmp
155         } else {
156           _result = 0
157         }
158         _result
159       } finally {
160         _stmt.close()
161       }
162     }
163   }
164 
165   public override suspend fun insertEntity(pk: Long) {
166     val _sql: String = "INSERT INTO MyEntity (pk) VALUES (?)"
167     return performSuspending(__db, false, true) { _connection ->
168       val _stmt: SQLiteStatement = _connection.prepare(_sql)
169       try {
170         var _argIndex: Int = 1
171         _stmt.bindLong(_argIndex, pk)
172         _stmt.step()
173       } finally {
174         _stmt.close()
175       }
176     }
177   }
178 
179   public override suspend fun insertEntityReturnLong(pk: Long): Long {
180     val _sql: String = "INSERT INTO MyEntity (pk) VALUES (?)"
181     return performSuspending(__db, false, true) { _connection ->
182       val _stmt: SQLiteStatement = _connection.prepare(_sql)
183       try {
184         var _argIndex: Int = 1
185         _stmt.bindLong(_argIndex, pk)
186         _stmt.step()
187         getLastInsertedRowId(_connection)
188       } finally {
189         _stmt.close()
190       }
191     }
192   }
193 
194   public override suspend fun updateEntity(text: String) {
195     val _sql: String = "UPDATE MyEntity SET other = ?"
196     return performSuspending(__db, false, true) { _connection ->
197       val _stmt: SQLiteStatement = _connection.prepare(_sql)
198       try {
199         var _argIndex: Int = 1
200         _stmt.bindText(_argIndex, text)
201         _stmt.step()
202       } finally {
203         _stmt.close()
204       }
205     }
206   }
207 
208   public override suspend fun updateEntityReturnInt(pk: Long, text: String): Int {
209     val _sql: String = "UPDATE MyEntity SET other = ? WHERE pk = ?"
210     return performSuspending(__db, false, true) { _connection ->
211       val _stmt: SQLiteStatement = _connection.prepare(_sql)
212       try {
213         var _argIndex: Int = 1
214         _stmt.bindText(_argIndex, text)
215         _argIndex = 2
216         _stmt.bindLong(_argIndex, pk)
217         _stmt.step()
218         getTotalChangedRows(_connection)
219       } finally {
220         _stmt.close()
221       }
222     }
223   }
224 
225   public override suspend fun deleteEntity() {
226     val _sql: String = "DELETE FROM MyEntity"
227     return performSuspending(__db, false, true) { _connection ->
228       val _stmt: SQLiteStatement = _connection.prepare(_sql)
229       try {
230         _stmt.step()
231       } finally {
232         _stmt.close()
233       }
234     }
235   }
236 
237   public override suspend fun deleteEntityReturnInt(): Int {
238     val _sql: String = "DELETE FROM MyEntity"
239     return performSuspending(__db, false, true) { _connection ->
240       val _stmt: SQLiteStatement = _connection.prepare(_sql)
241       try {
242         _stmt.step()
243         getTotalChangedRows(_connection)
244       } finally {
245         _stmt.close()
246       }
247     }
248   }
249 
250   public override suspend fun deleteEntitiesIn(pks: List<Long>) {
251     val _stringBuilder: StringBuilder = StringBuilder()
252     _stringBuilder.append("DELETE FROM MyEntity WHERE pk IN (")
253     val _inputSize: Int = pks.size
254     appendPlaceholders(_stringBuilder, _inputSize)
255     _stringBuilder.append(")")
256     val _sql: String = _stringBuilder.toString()
257     return performSuspending(__db, false, true) { _connection ->
258       val _stmt: SQLiteStatement = _connection.prepare(_sql)
259       try {
260         var _argIndex: Int = 1
261         for (_item: Long in pks) {
262           _stmt.bindLong(_argIndex, _item)
263           _argIndex++
264         }
265         _stmt.step()
266       } finally {
267         _stmt.close()
268       }
269     }
270   }
271 
272   public companion object {
273     public fun getRequiredConverters(): List<KClass<*>> = emptyList()
274   }
275 }
276