<lambda>null1 import androidx.room.AmbiguousColumnResolver
2 import androidx.room.RoomDatabase
3 import androidx.room.util.getColumnIndex
4 import androidx.room.util.performBlocking
5 import androidx.room.util.wrapMappedColumns
6 import androidx.sqlite.SQLiteStatement
7 import javax.`annotation`.processing.Generated
8 import kotlin.Array
9 import kotlin.Int
10 import kotlin.IntArray
11 import kotlin.String
12 import kotlin.Suppress
13 import kotlin.collections.LinkedHashMap
14 import kotlin.collections.List
15 import kotlin.collections.Map
16 import kotlin.collections.MutableList
17 import kotlin.collections.MutableMap
18 import kotlin.collections.mutableListOf
19 import kotlin.reflect.KClass
20 
21 @Generated(value = ["androidx.room.RoomProcessor"])
22 @Suppress(names = ["UNCHECKED_CAST", "DEPRECATION", "REDUNDANT_PROJECTION", "REMOVAL"])
23 public class MyDao_Impl(
24   __db: RoomDatabase,
25 ) : MyDao {
26   private val __db: RoomDatabase
27   init {
28     this.__db = __db
29   }
30 
31   public override fun getUserCommentMap(): Map<User, List<Comment>> {
32     val _sql: String = "SELECT * FROM User JOIN Comment ON User.id = Comment.userId"
33     return performBlocking(__db, true, false) { _connection ->
34       val _stmt: SQLiteStatement = _connection.prepare(_sql)
35       try {
36         val _statementIndices: Array<IntArray> = AmbiguousColumnResolver.resolve(_stmt.getColumnNames(), arrayOf(arrayOf("id", "name"), arrayOf("id", "userId", "text")))
37         val _result: MutableMap<User, MutableList<Comment>> = LinkedHashMap<User, MutableList<Comment>>()
38         while (_stmt.step()) {
39           val _key: User
40           val _tmpId: Int
41           _tmpId = _stmt.getLong(_statementIndices[0][0]).toInt()
42           val _tmpName: String
43           _tmpName = _stmt.getText(_statementIndices[0][1])
44           _key = User(_tmpId,_tmpName)
45           val _values: MutableList<Comment>
46           if (_result.containsKey(_key)) {
47             _values = _result.getValue(_key)
48           } else {
49             _values = mutableListOf()
50             _result.put(_key, _values)
51           }
52           if (_stmt.isNull(_statementIndices[1][0]) && _stmt.isNull(_statementIndices[1][1]) && _stmt.isNull(_statementIndices[1][2])) {
53             continue
54           }
55           val _value: Comment
56           val _tmpId_1: Int
57           _tmpId_1 = _stmt.getLong(_statementIndices[1][0]).toInt()
58           val _tmpUserId: Int
59           _tmpUserId = _stmt.getLong(_statementIndices[1][1]).toInt()
60           val _tmpText: String
61           _tmpText = _stmt.getText(_statementIndices[1][2])
62           _value = Comment(_tmpId_1,_tmpUserId,_tmpText)
63           _values.add(_value)
64         }
65         _result
66       } finally {
67         _stmt.close()
68       }
69     }
70   }
71 
72   public override fun getUserCommentMapWithoutStarProjection(): Map<User, List<Comment>> {
73     val _sql: String = "SELECT User.id, name, Comment.id, userId, text FROM User JOIN Comment ON User.id = Comment.userId"
74     return performBlocking(__db, true, false) { _connection ->
75       val _stmt: SQLiteStatement = _connection.prepare(_sql)
76       try {
77         val _statementIndices: Array<IntArray> = arrayOf(intArrayOf(0, 1), intArrayOf(2, 3, 4))
78         val _result: MutableMap<User, MutableList<Comment>> = LinkedHashMap<User, MutableList<Comment>>()
79         while (_stmt.step()) {
80           val _key: User
81           val _tmpId: Int
82           _tmpId = _stmt.getLong(_statementIndices[0][0]).toInt()
83           val _tmpName: String
84           _tmpName = _stmt.getText(_statementIndices[0][1])
85           _key = User(_tmpId,_tmpName)
86           val _values: MutableList<Comment>
87           if (_result.containsKey(_key)) {
88             _values = _result.getValue(_key)
89           } else {
90             _values = mutableListOf()
91             _result.put(_key, _values)
92           }
93           if (_stmt.isNull(_statementIndices[1][0]) && _stmt.isNull(_statementIndices[1][1]) && _stmt.isNull(_statementIndices[1][2])) {
94             continue
95           }
96           val _value: Comment
97           val _tmpId_1: Int
98           _tmpId_1 = _stmt.getLong(_statementIndices[1][0]).toInt()
99           val _tmpUserId: Int
100           _tmpUserId = _stmt.getLong(_statementIndices[1][1]).toInt()
101           val _tmpText: String
102           _tmpText = _stmt.getText(_statementIndices[1][2])
103           _value = Comment(_tmpId_1,_tmpUserId,_tmpText)
104           _values.add(_value)
105         }
106         _result
107       } finally {
108         _stmt.close()
109       }
110     }
111   }
112 
113   public override fun getUserCommentMapWithoutQueryVerification(): Map<User, List<Comment>> {
114     val _sql: String = "SELECT * FROM User JOIN Comment ON User.id = Comment.userId"
115     return performBlocking(__db, true, false) { _connection ->
116       val _stmt: SQLiteStatement = _connection.prepare(_sql)
117       try {
118         val _statementIndices: Array<IntArray> = AmbiguousColumnResolver.resolve(_stmt.getColumnNames(), arrayOf(arrayOf("id", "name"), arrayOf("id", "userId", "text")))
119         val _wrappedStmt: SQLiteStatement = wrapMappedColumns(_stmt, arrayOf("id", "name"), intArrayOf(_statementIndices[0][0], _statementIndices[0][1]))
120         val _wrappedStmt_1: SQLiteStatement = wrapMappedColumns(_stmt, arrayOf("id", "userId", "text"), intArrayOf(_statementIndices[1][0], _statementIndices[1][1], _statementIndices[1][2]))
121         val _result: MutableMap<User, MutableList<Comment>> = LinkedHashMap<User, MutableList<Comment>>()
122         while (_stmt.step()) {
123           val _key: User
124           _key = __entityStatementConverter_User(_wrappedStmt)
125           val _values: MutableList<Comment>
126           if (_result.containsKey(_key)) {
127             _values = _result.getValue(_key)
128           } else {
129             _values = mutableListOf()
130             _result.put(_key, _values)
131           }
132           if (_stmt.isNull(_statementIndices[1][0]) && _stmt.isNull(_statementIndices[1][1]) && _stmt.isNull(_statementIndices[1][2])) {
133             continue
134           }
135           val _value: Comment
136           _value = __entityStatementConverter_Comment(_wrappedStmt_1)
137           _values.add(_value)
138         }
139         _result
140       } finally {
141         _stmt.close()
142       }
143     }
144   }
145 
146   private fun __entityStatementConverter_User(statement: SQLiteStatement): User {
147     val _entity: User
148     val _columnIndexOfId: Int = getColumnIndex(statement, "id")
149     val _columnIndexOfName: Int = getColumnIndex(statement, "name")
150     val _tmpId: Int
151     if (_columnIndexOfId == -1) {
152       _tmpId = 0
153     } else {
154       _tmpId = statement.getLong(_columnIndexOfId).toInt()
155     }
156     val _tmpName: String
157     if (_columnIndexOfName == -1) {
158       error("Missing value for a NON-NULL column 'name', found NULL value instead.")
159     } else {
160       _tmpName = statement.getText(_columnIndexOfName)
161     }
162     _entity = User(_tmpId,_tmpName)
163     return _entity
164   }
165 
166   private fun __entityStatementConverter_Comment(statement: SQLiteStatement): Comment {
167     val _entity: Comment
168     val _columnIndexOfId: Int = getColumnIndex(statement, "id")
169     val _columnIndexOfUserId: Int = getColumnIndex(statement, "userId")
170     val _columnIndexOfText: Int = getColumnIndex(statement, "text")
171     val _tmpId: Int
172     if (_columnIndexOfId == -1) {
173       _tmpId = 0
174     } else {
175       _tmpId = statement.getLong(_columnIndexOfId).toInt()
176     }
177     val _tmpUserId: Int
178     if (_columnIndexOfUserId == -1) {
179       _tmpUserId = 0
180     } else {
181       _tmpUserId = statement.getLong(_columnIndexOfUserId).toInt()
182     }
183     val _tmpText: String
184     if (_columnIndexOfText == -1) {
185       error("Missing value for a NON-NULL column 'text', found NULL value instead.")
186     } else {
187       _tmpText = statement.getText(_columnIndexOfText)
188     }
189     _entity = Comment(_tmpId,_tmpUserId,_tmpText)
190     return _entity
191   }
192 
193   public companion object {
194     public fun getRequiredConverters(): List<KClass<*>> = emptyList()
195   }
196 }
197