Daniel Santiago Rivera | dd77499 | 2022-10-11 22:07:14 -0400 | [diff] [blame] | 1 | import android.database.Cursor |
| 2 | import android.os.CancellationSignal |
| 3 | import androidx.room.CoroutinesRoom.Companion.execute |
| 4 | import androidx.room.RoomDatabase |
| 5 | import androidx.room.RoomSQLiteQuery |
| 6 | import androidx.room.RoomSQLiteQuery.Companion.acquire |
| 7 | import androidx.room.util.createCancellationSignal |
| 8 | import androidx.room.util.getColumnIndexOrThrow |
| 9 | import androidx.room.util.query |
| 10 | import java.lang.Class |
| 11 | import java.util.concurrent.Callable |
| 12 | import javax.`annotation`.processing.Generated |
| 13 | import kotlin.Int |
| 14 | import kotlin.String |
| 15 | import kotlin.Suppress |
| 16 | import kotlin.collections.List |
| 17 | import kotlin.jvm.JvmStatic |
| 18 | |
| 19 | @Generated(value = ["androidx.room.RoomProcessor"]) |
elifbilgin | d46e8c1 | 2023-01-17 09:32:11 -0800 | [diff] [blame] | 20 | @Suppress(names = ["UNCHECKED_CAST", "DEPRECATION", "REDUNDANT_PROJECTION"]) |
Daniel Santiago Rivera | e695d18 | 2022-11-08 21:12:14 -0500 | [diff] [blame] | 21 | public class MyDao_Impl( |
| 22 | __db: RoomDatabase, |
| 23 | ) : MyDao { |
Daniel Santiago Rivera | dd77499 | 2022-10-11 22:07:14 -0400 | [diff] [blame] | 24 | private val __db: RoomDatabase |
Daniel Santiago Rivera | e695d18 | 2022-11-08 21:12:14 -0500 | [diff] [blame] | 25 | init { |
Daniel Santiago Rivera | dd77499 | 2022-10-11 22:07:14 -0400 | [diff] [blame] | 26 | 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 { |
elifbilgin | 22935ce | 2023-07-25 14:14:10 -0700 | [diff] [blame^] | 44 | error("The query result was empty, but expected a single row to return a NON-NULL object of type <MyEntity>.") |
Daniel Santiago Rivera | dd77499 | 2022-10-11 22:07:14 -0400 | [diff] [blame] | 45 | } |
| 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 | } |