blob: ef156333494f0880385bfcb17976ce3298349c7f [file] [log] [blame]
Daniel Santiago Riveradd774992022-10-11 22:07:14 -04001import android.database.Cursor
2import android.os.CancellationSignal
3import androidx.room.CoroutinesRoom.Companion.execute
4import androidx.room.RoomDatabase
5import androidx.room.RoomSQLiteQuery
6import androidx.room.RoomSQLiteQuery.Companion.acquire
7import androidx.room.util.createCancellationSignal
8import androidx.room.util.getColumnIndexOrThrow
9import androidx.room.util.query
10import java.lang.Class
11import java.util.concurrent.Callable
12import javax.`annotation`.processing.Generated
13import kotlin.Int
14import kotlin.String
15import kotlin.Suppress
16import kotlin.collections.List
17import kotlin.jvm.JvmStatic
18
19@Generated(value = ["androidx.room.RoomProcessor"])
elifbilgind46e8c12023-01-17 09:32:11 -080020@Suppress(names = ["UNCHECKED_CAST", "DEPRECATION", "REDUNDANT_PROJECTION"])
Daniel Santiago Riverae695d182022-11-08 21:12:14 -050021public class MyDao_Impl(
22 __db: RoomDatabase,
23) : MyDao {
Daniel Santiago Riveradd774992022-10-11 22:07:14 -040024 private val __db: RoomDatabase
Daniel Santiago Riverae695d182022-11-08 21:12:14 -050025 init {
Daniel Santiago Riveradd774992022-10-11 22:07:14 -040026 this.__db = __db
27 }
28
29 public override suspend fun getEntity(): MyEntity {
30 val _sql: String = "SELECT * FROM MyEntity"
31 val _statement: RoomSQLiteQuery = acquire(_sql, 0)
32 val _cancellationSignal: CancellationSignal? = createCancellationSignal()
33 return execute(__db, false, _cancellationSignal, object : Callable<MyEntity> {
34 public override fun call(): MyEntity {
35 val _cursor: Cursor = query(__db, _statement, false, null)
36 try {
37 val _cursorIndexOfPk: Int = getColumnIndexOrThrow(_cursor, "pk")
38 val _result: MyEntity
39 if (_cursor.moveToFirst()) {
40 val _tmpPk: Int
41 _tmpPk = _cursor.getInt(_cursorIndexOfPk)
42 _result = MyEntity(_tmpPk)
43 } else {
elifbilgin22935ce2023-07-25 14:14:10 -070044 error("The query result was empty, but expected a single row to return a NON-NULL object of type <MyEntity>.")
Daniel Santiago Riveradd774992022-10-11 22:07:14 -040045 }
46 return _result
47 } finally {
48 _cursor.close()
49 _statement.release()
50 }
51 }
52 })
53 }
54
55 public companion object {
56 @JvmStatic
57 public fun getRequiredConverters(): List<Class<*>> = emptyList()
58 }
59}