Daniel Santiago Rivera | 6e6b63a | 2022-10-27 19:04:31 -0400 | [diff] [blame] | 1 | import androidx.room.EntityDeletionOrUpdateAdapter |
| 2 | import androidx.room.RoomDatabase |
| 3 | import androidx.sqlite.db.SupportSQLiteStatement |
| 4 | import java.lang.Class |
| 5 | import javax.`annotation`.processing.Generated |
| 6 | import kotlin.Int |
| 7 | import kotlin.String |
| 8 | import kotlin.Suppress |
| 9 | import kotlin.Unit |
| 10 | import kotlin.collections.List |
| 11 | import kotlin.jvm.JvmStatic |
| 12 | |
| 13 | @Generated(value = ["androidx.room.RoomProcessor"]) |
elifbilgin | d46e8c1 | 2023-01-17 09:32:11 -0800 | [diff] [blame^] | 14 | @Suppress(names = ["UNCHECKED_CAST", "DEPRECATION", "REDUNDANT_PROJECTION"]) |
Daniel Santiago Rivera | e695d18 | 2022-11-08 21:12:14 -0500 | [diff] [blame] | 15 | public class MyDao_Impl( |
| 16 | __db: RoomDatabase, |
| 17 | ) : MyDao { |
Daniel Santiago Rivera | 6e6b63a | 2022-10-27 19:04:31 -0400 | [diff] [blame] | 18 | private val __db: RoomDatabase |
| 19 | |
| 20 | private val __deletionAdapterOfMyEntity: EntityDeletionOrUpdateAdapter<MyEntity> |
| 21 | |
| 22 | private val __updateAdapterOfMyEntity: EntityDeletionOrUpdateAdapter<MyEntity> |
Daniel Santiago Rivera | e695d18 | 2022-11-08 21:12:14 -0500 | [diff] [blame] | 23 | init { |
Daniel Santiago Rivera | 6e6b63a | 2022-10-27 19:04:31 -0400 | [diff] [blame] | 24 | this.__db = __db |
| 25 | this.__deletionAdapterOfMyEntity = object : EntityDeletionOrUpdateAdapter<MyEntity>(__db) { |
| 26 | public override fun createQuery(): String = "DELETE FROM `MyEntity` WHERE `pk` = ?" |
| 27 | |
| 28 | public override fun bind(statement: SupportSQLiteStatement, entity: MyEntity): Unit { |
| 29 | statement.bindLong(1, entity.pk) |
| 30 | } |
| 31 | } |
| 32 | this.__updateAdapterOfMyEntity = object : EntityDeletionOrUpdateAdapter<MyEntity>(__db) { |
| 33 | public override fun createQuery(): String = |
| 34 | "UPDATE OR ABORT `MyEntity` SET `pk` = ?,`data` = ? WHERE `pk` = ?" |
| 35 | |
| 36 | public override fun bind(statement: SupportSQLiteStatement, entity: MyEntity): Unit { |
| 37 | statement.bindLong(1, entity.pk) |
| 38 | statement.bindString(2, entity.data) |
| 39 | statement.bindLong(3, entity.pk) |
| 40 | } |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | public override fun deleteEntity(item: MyEntity): Unit { |
| 45 | __db.assertNotSuspendingTransaction() |
| 46 | __db.beginTransaction() |
| 47 | try { |
| 48 | __deletionAdapterOfMyEntity.handle(item) |
| 49 | __db.setTransactionSuccessful() |
| 50 | } finally { |
| 51 | __db.endTransaction() |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | public override fun deleteEntityAndReturnCount(item: MyEntity): Int { |
| 56 | __db.assertNotSuspendingTransaction() |
| 57 | var _total: Int = 0 |
| 58 | __db.beginTransaction() |
| 59 | try { |
| 60 | _total += __deletionAdapterOfMyEntity.handle(item) |
| 61 | __db.setTransactionSuccessful() |
| 62 | return _total |
| 63 | } finally { |
| 64 | __db.endTransaction() |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | public override fun updateEntity(item: MyEntity): Unit { |
| 69 | __db.assertNotSuspendingTransaction() |
| 70 | __db.beginTransaction() |
| 71 | try { |
| 72 | __updateAdapterOfMyEntity.handle(item) |
| 73 | __db.setTransactionSuccessful() |
| 74 | } finally { |
| 75 | __db.endTransaction() |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | public override fun updateEntityAndReturnCount(item: MyEntity): Int { |
| 80 | __db.assertNotSuspendingTransaction() |
| 81 | var _total: Int = 0 |
| 82 | __db.beginTransaction() |
| 83 | try { |
| 84 | _total += __updateAdapterOfMyEntity.handle(item) |
| 85 | __db.setTransactionSuccessful() |
| 86 | return _total |
| 87 | } finally { |
| 88 | __db.endTransaction() |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | public companion object { |
| 93 | @JvmStatic |
| 94 | public fun getRequiredConverters(): List<Class<*>> = emptyList() |
| 95 | } |
| 96 | } |