Daniel Santiago Rivera | 0cb4198 | 2022-10-12 13:26:54 -0400 | [diff] [blame] | 1 | import android.database.Cursor |
| 2 | import androidx.room.RoomDatabase |
| 3 | import androidx.room.RoomSQLiteQuery |
| 4 | import androidx.room.RoomSQLiteQuery.Companion.acquire |
| 5 | import androidx.room.util.getColumnIndexOrThrow |
| 6 | import androidx.room.util.query |
| 7 | import java.lang.Class |
| 8 | import javax.`annotation`.processing.Generated |
| 9 | import kotlin.Int |
| 10 | import kotlin.String |
| 11 | import kotlin.Suppress |
| 12 | import kotlin.collections.List |
| 13 | import kotlin.jvm.JvmStatic |
| 14 | |
| 15 | @Generated(value = ["androidx.room.RoomProcessor"]) |
elifbilgin | d46e8c1 | 2023-01-17 09:32:11 -0800 | [diff] [blame] | 16 | @Suppress(names = ["UNCHECKED_CAST", "DEPRECATION", "REDUNDANT_PROJECTION"]) |
Daniel Santiago Rivera | e695d18 | 2022-11-08 21:12:14 -0500 | [diff] [blame] | 17 | public class MyDao_Impl( |
| 18 | __db: RoomDatabase, |
| 19 | ) : MyDao { |
Daniel Santiago Rivera | 0cb4198 | 2022-10-12 13:26:54 -0400 | [diff] [blame] | 20 | private val __db: RoomDatabase |
Daniel Santiago Rivera | e695d18 | 2022-11-08 21:12:14 -0500 | [diff] [blame] | 21 | init { |
Daniel Santiago Rivera | 0cb4198 | 2022-10-12 13:26:54 -0400 | [diff] [blame] | 22 | this.__db = __db |
| 23 | } |
| 24 | |
| 25 | public override fun stringParam(arg: String): MyEntity { |
| 26 | val _sql: String = "SELECT * FROM MyEntity WHERE string = ?" |
| 27 | val _statement: RoomSQLiteQuery = acquire(_sql, 1) |
| 28 | var _argIndex: Int = 1 |
| 29 | _statement.bindString(_argIndex, arg) |
| 30 | __db.assertNotSuspendingTransaction() |
| 31 | val _cursor: Cursor = query(__db, _statement, false, null) |
| 32 | try { |
| 33 | val _cursorIndexOfString: Int = getColumnIndexOrThrow(_cursor, "string") |
| 34 | val _result: MyEntity |
| 35 | if (_cursor.moveToFirst()) { |
| 36 | val _tmpString: String |
| 37 | _tmpString = _cursor.getString(_cursorIndexOfString) |
| 38 | _result = MyEntity(_tmpString) |
| 39 | } else { |
elifbilgin | 22935ce | 2023-07-25 14:14:10 -0700 | [diff] [blame^] | 40 | error("The query result was empty, but expected a single row to return a NON-NULL object of type <MyEntity>.") |
Daniel Santiago Rivera | 0cb4198 | 2022-10-12 13:26:54 -0400 | [diff] [blame] | 41 | } |
| 42 | return _result |
| 43 | } finally { |
| 44 | _cursor.close() |
| 45 | _statement.release() |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | public override fun nullableStringParam(arg: String?): MyEntity { |
| 50 | val _sql: String = "SELECT * FROM MyEntity WHERE string = ?" |
| 51 | val _statement: RoomSQLiteQuery = acquire(_sql, 1) |
| 52 | var _argIndex: Int = 1 |
| 53 | if (arg == null) { |
| 54 | _statement.bindNull(_argIndex) |
| 55 | } else { |
| 56 | _statement.bindString(_argIndex, arg) |
| 57 | } |
| 58 | __db.assertNotSuspendingTransaction() |
| 59 | val _cursor: Cursor = query(__db, _statement, false, null) |
| 60 | try { |
| 61 | val _cursorIndexOfString: Int = getColumnIndexOrThrow(_cursor, "string") |
| 62 | val _result: MyEntity |
| 63 | if (_cursor.moveToFirst()) { |
| 64 | val _tmpString: String |
| 65 | _tmpString = _cursor.getString(_cursorIndexOfString) |
| 66 | _result = MyEntity(_tmpString) |
| 67 | } else { |
elifbilgin | 22935ce | 2023-07-25 14:14:10 -0700 | [diff] [blame^] | 68 | error("The query result was empty, but expected a single row to return a NON-NULL object of type <MyEntity>.") |
Daniel Santiago Rivera | 0cb4198 | 2022-10-12 13:26:54 -0400 | [diff] [blame] | 69 | } |
| 70 | return _result |
| 71 | } finally { |
| 72 | _cursor.close() |
| 73 | _statement.release() |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | public companion object { |
| 78 | @JvmStatic |
| 79 | public fun getRequiredConverters(): List<Class<*>> = emptyList() |
| 80 | } |
| 81 | } |