<lambda>null1 import androidx.room.RoomDatabase
2 import androidx.room.util.appendPlaceholders
3 import androidx.room.util.getLastInsertedRowId
4 import androidx.room.util.getTotalChangedRows
5 import androidx.room.util.performBlocking
6 import androidx.sqlite.SQLiteStatement
7 import java.lang.Void
8 import javax.`annotation`.processing.Generated
9 import kotlin.Int
10 import kotlin.Long
11 import kotlin.String
12 import kotlin.Suppress
13 import kotlin.collections.List
14 import kotlin.reflect.KClass
15 import kotlin.text.StringBuilder
16
17 @Generated(value = ["androidx.room.RoomProcessor"])
18 @Suppress(names = ["UNCHECKED_CAST", "DEPRECATION", "REDUNDANT_PROJECTION", "REMOVAL"])
19 public class MyDao_Impl(
20 __db: RoomDatabase,
21 ) : MyDao {
22 private val __db: RoomDatabase
23 init {
24 this.__db = __db
25 }
26
27 public override fun insertEntity(id: Long) {
28 val _sql: String = "INSERT INTO MyEntity (id) VALUES (?)"
29 return performBlocking(__db, false, true) { _connection ->
30 val _stmt: SQLiteStatement = _connection.prepare(_sql)
31 try {
32 var _argIndex: Int = 1
33 _stmt.bindLong(_argIndex, id)
34 _stmt.step()
35 } finally {
36 _stmt.close()
37 }
38 }
39 }
40
41 public override fun insertEntityReturnLong(id: Long): Long {
42 val _sql: String = "INSERT INTO MyEntity (id) VALUES (?)"
43 return performBlocking(__db, false, true) { _connection ->
44 val _stmt: SQLiteStatement = _connection.prepare(_sql)
45 try {
46 var _argIndex: Int = 1
47 _stmt.bindLong(_argIndex, id)
48 _stmt.step()
49 getLastInsertedRowId(_connection)
50 } finally {
51 _stmt.close()
52 }
53 }
54 }
55
56 public override fun insertEntityReturnVoid(id: Long): Void? {
57 val _sql: String = "INSERT INTO MyEntity (id) VALUES (?)"
58 return performBlocking(__db, false, true) { _connection ->
59 val _stmt: SQLiteStatement = _connection.prepare(_sql)
60 try {
61 var _argIndex: Int = 1
62 _stmt.bindLong(_argIndex, id)
63 _stmt.step()
64 null
65 } finally {
66 _stmt.close()
67 }
68 }
69 }
70
71 public override fun updateEntity(text: String) {
72 val _sql: String = "UPDATE MyEntity SET text = ?"
73 return performBlocking(__db, false, true) { _connection ->
74 val _stmt: SQLiteStatement = _connection.prepare(_sql)
75 try {
76 var _argIndex: Int = 1
77 _stmt.bindText(_argIndex, text)
78 _stmt.step()
79 } finally {
80 _stmt.close()
81 }
82 }
83 }
84
85 public override fun updateEntityReturnInt(id: Long, text: String): Int {
86 val _sql: String = "UPDATE MyEntity SET text = ? WHERE id = ?"
87 return performBlocking(__db, false, true) { _connection ->
88 val _stmt: SQLiteStatement = _connection.prepare(_sql)
89 try {
90 var _argIndex: Int = 1
91 _stmt.bindText(_argIndex, text)
92 _argIndex = 2
93 _stmt.bindLong(_argIndex, id)
94 _stmt.step()
95 getTotalChangedRows(_connection)
96 } finally {
97 _stmt.close()
98 }
99 }
100 }
101
102 public override fun deleteEntity() {
103 val _sql: String = "DELETE FROM MyEntity"
104 return performBlocking(__db, false, true) { _connection ->
105 val _stmt: SQLiteStatement = _connection.prepare(_sql)
106 try {
107 _stmt.step()
108 } finally {
109 _stmt.close()
110 }
111 }
112 }
113
114 public override fun deleteEntityReturnInt(): Int {
115 val _sql: String = "DELETE FROM MyEntity"
116 return performBlocking(__db, false, true) { _connection ->
117 val _stmt: SQLiteStatement = _connection.prepare(_sql)
118 try {
119 _stmt.step()
120 getTotalChangedRows(_connection)
121 } finally {
122 _stmt.close()
123 }
124 }
125 }
126
127 public override fun deleteEntitiesIn(ids: List<Long>) {
128 val _stringBuilder: StringBuilder = StringBuilder()
129 _stringBuilder.append("DELETE FROM MyEntity WHERE id IN (")
130 val _inputSize: Int = ids.size
131 appendPlaceholders(_stringBuilder, _inputSize)
132 _stringBuilder.append(")")
133 val _sql: String = _stringBuilder.toString()
134 return performBlocking(__db, false, true) { _connection ->
135 val _stmt: SQLiteStatement = _connection.prepare(_sql)
136 try {
137 var _argIndex: Int = 1
138 for (_item: Long in ids) {
139 _stmt.bindLong(_argIndex, _item)
140 _argIndex++
141 }
142 _stmt.step()
143 } finally {
144 _stmt.close()
145 }
146 }
147 }
148
149 public companion object {
150 public fun getRequiredConverters(): List<KClass<*>> = emptyList()
151 }
152 }
153