blob: 39e2b8f6f353a17f372ce550224e2492c6533994 [file] [log] [blame]
Daniel Santiago Rivera155f7ec2022-09-26 22:36:29 -04001import android.database.Cursor
Daniel Santiago Rivera0552a382022-10-05 23:11:51 -04002import androidx.room.EntityInsertionAdapter
Daniel Santiago Rivera885c9eb2022-09-29 21:49:35 -04003import androidx.room.RoomDatabase
4import androidx.room.RoomSQLiteQuery
5import androidx.room.RoomSQLiteQuery.Companion.acquire
6import androidx.room.util.getColumnIndexOrThrow
7import androidx.room.util.query
Daniel Santiago Rivera0552a382022-10-05 23:11:51 -04008import androidx.sqlite.db.SupportSQLiteStatement
Daniel Santiago Rivera885c9eb2022-09-29 21:49:35 -04009import java.lang.Class
Daniel Santiago Rivera155f7ec2022-09-26 22:36:29 -040010import javax.`annotation`.processing.Generated
11import kotlin.Byte
12import kotlin.Char
13import kotlin.Double
14import kotlin.Float
15import kotlin.Int
16import kotlin.Long
17import kotlin.Short
Daniel Santiago Rivera885c9eb2022-09-29 21:49:35 -040018import kotlin.String
Daniel Santiago Rivera155f7ec2022-09-26 22:36:29 -040019import kotlin.Suppress
Daniel Santiago Rivera885c9eb2022-09-29 21:49:35 -040020import kotlin.collections.List
21import kotlin.jvm.JvmStatic
Daniel Santiago Rivera155f7ec2022-09-26 22:36:29 -040022
23@Generated(value = ["androidx.room.RoomProcessor"])
elifbilgind46e8c12023-01-17 09:32:11 -080024@Suppress(names = ["UNCHECKED_CAST", "DEPRECATION", "REDUNDANT_PROJECTION"])
Daniel Santiago Riverae695d182022-11-08 21:12:14 -050025public class MyDao_Impl(
26 __db: RoomDatabase,
27) : MyDao {
Daniel Santiago Rivera885c9eb2022-09-29 21:49:35 -040028 private val __db: RoomDatabase
29
Daniel Santiago Rivera0552a382022-10-05 23:11:51 -040030 private val __insertionAdapterOfMyEntity: EntityInsertionAdapter<MyEntity>
Daniel Santiago Riverae695d182022-11-08 21:12:14 -050031 init {
Daniel Santiago Rivera885c9eb2022-09-29 21:49:35 -040032 this.__db = __db
Daniel Santiago Rivera0552a382022-10-05 23:11:51 -040033 this.__insertionAdapterOfMyEntity = object : EntityInsertionAdapter<MyEntity>(__db) {
34 public override fun createQuery(): String =
35 "INSERT OR ABORT INTO `MyEntity` (`int`,`short`,`byte`,`long`,`char`,`float`,`double`) VALUES (?,?,?,?,?,?,?)"
36
Daniel Santiago Riveraa6dec5a2023-05-02 15:09:07 -040037 public override fun bind(statement: SupportSQLiteStatement, entity: MyEntity) {
Daniel Santiago Riverabb3ff862023-03-24 10:55:09 -040038 val _tmpInt: Int? = entity.int
39 if (_tmpInt == null) {
Daniel Santiago Rivera0552a382022-10-05 23:11:51 -040040 statement.bindNull(1)
41 } else {
Daniel Santiago Riverabb3ff862023-03-24 10:55:09 -040042 statement.bindLong(1, _tmpInt.toLong())
Daniel Santiago Rivera0552a382022-10-05 23:11:51 -040043 }
Daniel Santiago Riverabb3ff862023-03-24 10:55:09 -040044 val _tmpShort: Short? = entity.short
45 if (_tmpShort == null) {
Daniel Santiago Rivera0552a382022-10-05 23:11:51 -040046 statement.bindNull(2)
47 } else {
Daniel Santiago Riverabb3ff862023-03-24 10:55:09 -040048 statement.bindLong(2, _tmpShort.toLong())
Daniel Santiago Rivera0552a382022-10-05 23:11:51 -040049 }
Daniel Santiago Riverabb3ff862023-03-24 10:55:09 -040050 val _tmpByte: Byte? = entity.byte
51 if (_tmpByte == null) {
Daniel Santiago Rivera0552a382022-10-05 23:11:51 -040052 statement.bindNull(3)
53 } else {
Daniel Santiago Riverabb3ff862023-03-24 10:55:09 -040054 statement.bindLong(3, _tmpByte.toLong())
Daniel Santiago Rivera0552a382022-10-05 23:11:51 -040055 }
Daniel Santiago Riverabb3ff862023-03-24 10:55:09 -040056 val _tmpLong: Long? = entity.long
57 if (_tmpLong == null) {
Daniel Santiago Rivera0552a382022-10-05 23:11:51 -040058 statement.bindNull(4)
59 } else {
Daniel Santiago Riverabb3ff862023-03-24 10:55:09 -040060 statement.bindLong(4, _tmpLong)
Daniel Santiago Rivera0552a382022-10-05 23:11:51 -040061 }
Daniel Santiago Riverabb3ff862023-03-24 10:55:09 -040062 val _tmpChar: Char? = entity.char
63 if (_tmpChar == null) {
Daniel Santiago Rivera0552a382022-10-05 23:11:51 -040064 statement.bindNull(5)
65 } else {
Daniel Santiago Riverabb3ff862023-03-24 10:55:09 -040066 statement.bindLong(5, _tmpChar.toLong())
Daniel Santiago Rivera0552a382022-10-05 23:11:51 -040067 }
Daniel Santiago Riverabb3ff862023-03-24 10:55:09 -040068 val _tmpFloat: Float? = entity.float
69 if (_tmpFloat == null) {
Daniel Santiago Rivera0552a382022-10-05 23:11:51 -040070 statement.bindNull(6)
71 } else {
Daniel Santiago Riverabb3ff862023-03-24 10:55:09 -040072 statement.bindDouble(6, _tmpFloat.toDouble())
Daniel Santiago Rivera0552a382022-10-05 23:11:51 -040073 }
Daniel Santiago Riverabb3ff862023-03-24 10:55:09 -040074 val _tmpDouble: Double? = entity.double
75 if (_tmpDouble == null) {
Daniel Santiago Rivera0552a382022-10-05 23:11:51 -040076 statement.bindNull(7)
77 } else {
Daniel Santiago Riverabb3ff862023-03-24 10:55:09 -040078 statement.bindDouble(7, _tmpDouble)
Daniel Santiago Rivera0552a382022-10-05 23:11:51 -040079 }
80 }
81 }
82 }
83
Daniel Santiago Riveraa6dec5a2023-05-02 15:09:07 -040084 public override fun addEntity(item: MyEntity) {
Daniel Santiago Rivera0552a382022-10-05 23:11:51 -040085 __db.assertNotSuspendingTransaction()
86 __db.beginTransaction()
87 try {
88 __insertionAdapterOfMyEntity.insert(item)
89 __db.setTransactionSuccessful()
90 } finally {
91 __db.endTransaction()
92 }
Daniel Santiago Rivera885c9eb2022-09-29 21:49:35 -040093 }
94
95 public override fun getEntity(): MyEntity {
96 val _sql: String = "SELECT * FROM MyEntity"
97 val _statement: RoomSQLiteQuery = acquire(_sql, 0)
98 __db.assertNotSuspendingTransaction()
99 val _cursor: Cursor = query(__db, _statement, false, null)
100 try {
101 val _cursorIndexOfInt: Int = getColumnIndexOrThrow(_cursor, "int")
102 val _cursorIndexOfShort: Int = getColumnIndexOrThrow(_cursor, "short")
103 val _cursorIndexOfByte: Int = getColumnIndexOrThrow(_cursor, "byte")
104 val _cursorIndexOfLong: Int = getColumnIndexOrThrow(_cursor, "long")
105 val _cursorIndexOfChar: Int = getColumnIndexOrThrow(_cursor, "char")
106 val _cursorIndexOfFloat: Int = getColumnIndexOrThrow(_cursor, "float")
107 val _cursorIndexOfDouble: Int = getColumnIndexOrThrow(_cursor, "double")
108 val _result: MyEntity
109 if (_cursor.moveToFirst()) {
110 val _tmpInt: Int?
111 if (_cursor.isNull(_cursorIndexOfInt)) {
112 _tmpInt = null
113 } else {
114 _tmpInt = _cursor.getInt(_cursorIndexOfInt)
115 }
116 val _tmpShort: Short?
117 if (_cursor.isNull(_cursorIndexOfShort)) {
118 _tmpShort = null
119 } else {
120 _tmpShort = _cursor.getShort(_cursorIndexOfShort)
121 }
122 val _tmpByte: Byte?
123 if (_cursor.isNull(_cursorIndexOfByte)) {
124 _tmpByte = null
125 } else {
126 _tmpByte = _cursor.getShort(_cursorIndexOfByte).toByte()
127 }
128 val _tmpLong: Long?
129 if (_cursor.isNull(_cursorIndexOfLong)) {
130 _tmpLong = null
131 } else {
132 _tmpLong = _cursor.getLong(_cursorIndexOfLong)
133 }
134 val _tmpChar: Char?
135 if (_cursor.isNull(_cursorIndexOfChar)) {
136 _tmpChar = null
137 } else {
138 _tmpChar = _cursor.getInt(_cursorIndexOfChar).toChar()
139 }
140 val _tmpFloat: Float?
141 if (_cursor.isNull(_cursorIndexOfFloat)) {
142 _tmpFloat = null
143 } else {
144 _tmpFloat = _cursor.getFloat(_cursorIndexOfFloat)
145 }
146 val _tmpDouble: Double?
147 if (_cursor.isNull(_cursorIndexOfDouble)) {
148 _tmpDouble = null
149 } else {
150 _tmpDouble = _cursor.getDouble(_cursorIndexOfDouble)
151 }
152 _result = MyEntity(_tmpInt,_tmpShort,_tmpByte,_tmpLong,_tmpChar,_tmpFloat,_tmpDouble)
153 } else {
elifbilgin22935ce2023-07-25 14:14:10 -0700154 error("The query result was empty, but expected a single row to return a NON-NULL object of type <MyEntity>.")
Daniel Santiago Rivera885c9eb2022-09-29 21:49:35 -0400155 }
156 return _result
157 } finally {
158 _cursor.close()
159 _statement.release()
Daniel Santiago Rivera155f7ec2022-09-26 22:36:29 -0400160 }
Daniel Santiago Rivera885c9eb2022-09-29 21:49:35 -0400161 }
162
163 public companion object {
164 @JvmStatic
165 public fun getRequiredConverters(): List<Class<*>> = emptyList()
Daniel Santiago Rivera155f7ec2022-09-26 22:36:29 -0400166 }
167}