<lambda>null1 import androidx.room.EntityInsertAdapter
2 import androidx.room.RoomDatabase
3 import androidx.room.util.getColumnIndexOrThrow
4 import androidx.room.util.performBlocking
5 import androidx.sqlite.SQLiteStatement
6 import javax.`annotation`.processing.Generated
7 import kotlin.Byte
8 import kotlin.Char
9 import kotlin.Double
10 import kotlin.Float
11 import kotlin.Int
12 import kotlin.Long
13 import kotlin.Short
14 import kotlin.String
15 import kotlin.Suppress
16 import kotlin.Unit
17 import kotlin.collections.List
18 import kotlin.reflect.KClass
19
20 @Generated(value = ["androidx.room.RoomProcessor"])
21 @Suppress(names = ["UNCHECKED_CAST", "DEPRECATION", "REDUNDANT_PROJECTION", "REMOVAL"])
22 public class MyDao_Impl(
23 __db: RoomDatabase,
24 ) : MyDao {
25 private val __db: RoomDatabase
26
27 private val __insertAdapterOfMyEntity: EntityInsertAdapter<MyEntity>
28 init {
29 this.__db = __db
30 this.__insertAdapterOfMyEntity = object : EntityInsertAdapter<MyEntity>() {
31 protected override fun createQuery(): String = "INSERT OR ABORT INTO `MyEntity` (`int`,`short`,`byte`,`long`,`char`,`float`,`double`) VALUES (?,?,?,?,?,?,?)"
32
33 protected override fun bind(statement: SQLiteStatement, entity: MyEntity) {
34 val _tmpInt: Int? = entity.int
35 if (_tmpInt == null) {
36 statement.bindNull(1)
37 } else {
38 statement.bindLong(1, _tmpInt.toLong())
39 }
40 val _tmpShort: Short? = entity.short
41 if (_tmpShort == null) {
42 statement.bindNull(2)
43 } else {
44 statement.bindLong(2, _tmpShort.toLong())
45 }
46 val _tmpByte: Byte? = entity.byte
47 if (_tmpByte == null) {
48 statement.bindNull(3)
49 } else {
50 statement.bindLong(3, _tmpByte.toLong())
51 }
52 val _tmpLong: Long? = entity.long
53 if (_tmpLong == null) {
54 statement.bindNull(4)
55 } else {
56 statement.bindLong(4, _tmpLong)
57 }
58 val _tmpChar: Char? = entity.char
59 if (_tmpChar == null) {
60 statement.bindNull(5)
61 } else {
62 statement.bindLong(5, _tmpChar.toLong())
63 }
64 val _tmpFloat: Float? = entity.float
65 if (_tmpFloat == null) {
66 statement.bindNull(6)
67 } else {
68 statement.bindDouble(6, _tmpFloat.toDouble())
69 }
70 val _tmpDouble: Double? = entity.double
71 if (_tmpDouble == null) {
72 statement.bindNull(7)
73 } else {
74 statement.bindDouble(7, _tmpDouble)
75 }
76 }
77 }
78 }
79
80 public override fun addEntity(item: MyEntity): Unit = performBlocking(__db, false, true) { _connection ->
81 __insertAdapterOfMyEntity.insert(_connection, item)
82 }
83
84 public override fun getEntity(): MyEntity {
85 val _sql: String = "SELECT * FROM MyEntity"
86 return performBlocking(__db, true, false) { _connection ->
87 val _stmt: SQLiteStatement = _connection.prepare(_sql)
88 try {
89 val _columnIndexOfInt: Int = getColumnIndexOrThrow(_stmt, "int")
90 val _columnIndexOfShort: Int = getColumnIndexOrThrow(_stmt, "short")
91 val _columnIndexOfByte: Int = getColumnIndexOrThrow(_stmt, "byte")
92 val _columnIndexOfLong: Int = getColumnIndexOrThrow(_stmt, "long")
93 val _columnIndexOfChar: Int = getColumnIndexOrThrow(_stmt, "char")
94 val _columnIndexOfFloat: Int = getColumnIndexOrThrow(_stmt, "float")
95 val _columnIndexOfDouble: Int = getColumnIndexOrThrow(_stmt, "double")
96 val _result: MyEntity
97 if (_stmt.step()) {
98 val _tmpInt: Int?
99 if (_stmt.isNull(_columnIndexOfInt)) {
100 _tmpInt = null
101 } else {
102 _tmpInt = _stmt.getLong(_columnIndexOfInt).toInt()
103 }
104 val _tmpShort: Short?
105 if (_stmt.isNull(_columnIndexOfShort)) {
106 _tmpShort = null
107 } else {
108 _tmpShort = _stmt.getLong(_columnIndexOfShort).toShort()
109 }
110 val _tmpByte: Byte?
111 if (_stmt.isNull(_columnIndexOfByte)) {
112 _tmpByte = null
113 } else {
114 _tmpByte = _stmt.getLong(_columnIndexOfByte).toByte()
115 }
116 val _tmpLong: Long?
117 if (_stmt.isNull(_columnIndexOfLong)) {
118 _tmpLong = null
119 } else {
120 _tmpLong = _stmt.getLong(_columnIndexOfLong)
121 }
122 val _tmpChar: Char?
123 if (_stmt.isNull(_columnIndexOfChar)) {
124 _tmpChar = null
125 } else {
126 _tmpChar = _stmt.getLong(_columnIndexOfChar).toChar()
127 }
128 val _tmpFloat: Float?
129 if (_stmt.isNull(_columnIndexOfFloat)) {
130 _tmpFloat = null
131 } else {
132 _tmpFloat = _stmt.getDouble(_columnIndexOfFloat).toFloat()
133 }
134 val _tmpDouble: Double?
135 if (_stmt.isNull(_columnIndexOfDouble)) {
136 _tmpDouble = null
137 } else {
138 _tmpDouble = _stmt.getDouble(_columnIndexOfDouble)
139 }
140 _result = MyEntity(_tmpInt,_tmpShort,_tmpByte,_tmpLong,_tmpChar,_tmpFloat,_tmpDouble)
141 } else {
142 error("The query result was empty, but expected a single row to return a NON-NULL object of type <MyEntity>.")
143 }
144 _result
145 } finally {
146 _stmt.close()
147 }
148 }
149 }
150
151 public companion object {
152 public fun getRequiredConverters(): List<KClass<*>> = emptyList()
153 }
154 }
155