<lambda>null1 import androidx.room.RoomDatabase
2 import androidx.room.util.getColumnIndexOrThrow
3 import androidx.room.util.performBlocking
4 import androidx.sqlite.SQLiteStatement
5 import javax.`annotation`.processing.Generated
6 import kotlin.Int
7 import kotlin.String
8 import kotlin.Suppress
9 import kotlin.collections.LinkedHashMap
10 import kotlin.collections.List
11 import kotlin.collections.Map
12 import kotlin.collections.MutableList
13 import kotlin.collections.MutableMap
14 import kotlin.collections.mutableListOf
15 import kotlin.reflect.KClass
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 getSongsWithArtist(): Map<Song, Artist> {
28     val _sql: String = "SELECT * FROM Song JOIN Artist ON Song.artistKey = Artist.artistId"
29     return performBlocking(__db, true, false) { _connection ->
30       val _stmt: SQLiteStatement = _connection.prepare(_sql)
31       try {
32         val _columnIndexOfSongId: Int = getColumnIndexOrThrow(_stmt, "songId")
33         val _columnIndexOfArtistKey: Int = getColumnIndexOrThrow(_stmt, "artistKey")
34         val _columnIndexOfArtistId: Int = getColumnIndexOrThrow(_stmt, "artistId")
35         val _result: MutableMap<Song, Artist> = LinkedHashMap<Song, Artist>()
36         while (_stmt.step()) {
37           val _key: Song
38           val _tmpSongId: String
39           _tmpSongId = _stmt.getText(_columnIndexOfSongId)
40           val _tmpArtistKey: String
41           _tmpArtistKey = _stmt.getText(_columnIndexOfArtistKey)
42           _key = Song(_tmpSongId,_tmpArtistKey)
43           if (_stmt.isNull(_columnIndexOfArtistId)) {
44             error("The column(s) of the map value object of type 'Artist' are NULL but the map's value type argument expect it to be NON-NULL")
45           }
46           val _value: Artist
47           val _tmpArtistId: String
48           _tmpArtistId = _stmt.getText(_columnIndexOfArtistId)
49           _value = Artist(_tmpArtistId)
50           if (!_result.containsKey(_key)) {
51             _result.put(_key, _value)
52           }
53         }
54         _result
55       } finally {
56         _stmt.close()
57       }
58     }
59   }
60 
61   public override fun getArtistWithSongs(): Map<Artist, List<Song>> {
62     val _sql: String = "SELECT * FROM Artist JOIN Song ON Artist.artistId = Song.artistKey"
63     return performBlocking(__db, true, false) { _connection ->
64       val _stmt: SQLiteStatement = _connection.prepare(_sql)
65       try {
66         val _columnIndexOfArtistId: Int = getColumnIndexOrThrow(_stmt, "artistId")
67         val _columnIndexOfSongId: Int = getColumnIndexOrThrow(_stmt, "songId")
68         val _columnIndexOfArtistKey: Int = getColumnIndexOrThrow(_stmt, "artistKey")
69         val _result: MutableMap<Artist, MutableList<Song>> = LinkedHashMap<Artist, MutableList<Song>>()
70         while (_stmt.step()) {
71           val _key: Artist
72           val _tmpArtistId: String
73           _tmpArtistId = _stmt.getText(_columnIndexOfArtistId)
74           _key = Artist(_tmpArtistId)
75           val _values: MutableList<Song>
76           if (_result.containsKey(_key)) {
77             _values = _result.getValue(_key)
78           } else {
79             _values = mutableListOf()
80             _result.put(_key, _values)
81           }
82           if (_stmt.isNull(_columnIndexOfSongId) && _stmt.isNull(_columnIndexOfArtistKey)) {
83             continue
84           }
85           val _value: Song
86           val _tmpSongId: String
87           _tmpSongId = _stmt.getText(_columnIndexOfSongId)
88           val _tmpArtistKey: String
89           _tmpArtistKey = _stmt.getText(_columnIndexOfArtistKey)
90           _value = Song(_tmpSongId,_tmpArtistKey)
91           _values.add(_value)
92         }
93         _result
94       } finally {
95         _stmt.close()
96       }
97     }
98   }
99 
100   public override fun getArtistWithMutableSongs(): Map<Artist, MutableList<Song>> {
101     val _sql: String = "SELECT * FROM Artist JOIN Song ON Artist.artistId = Song.artistKey"
102     return performBlocking(__db, true, false) { _connection ->
103       val _stmt: SQLiteStatement = _connection.prepare(_sql)
104       try {
105         val _columnIndexOfArtistId: Int = getColumnIndexOrThrow(_stmt, "artistId")
106         val _columnIndexOfSongId: Int = getColumnIndexOrThrow(_stmt, "songId")
107         val _columnIndexOfArtistKey: Int = getColumnIndexOrThrow(_stmt, "artistKey")
108         val _result: MutableMap<Artist, MutableList<Song>> = LinkedHashMap<Artist, MutableList<Song>>()
109         while (_stmt.step()) {
110           val _key: Artist
111           val _tmpArtistId: String
112           _tmpArtistId = _stmt.getText(_columnIndexOfArtistId)
113           _key = Artist(_tmpArtistId)
114           val _values: MutableList<Song>
115           if (_result.containsKey(_key)) {
116             _values = _result.getValue(_key)
117           } else {
118             _values = mutableListOf()
119             _result.put(_key, _values)
120           }
121           if (_stmt.isNull(_columnIndexOfSongId) && _stmt.isNull(_columnIndexOfArtistKey)) {
122             continue
123           }
124           val _value: Song
125           val _tmpSongId: String
126           _tmpSongId = _stmt.getText(_columnIndexOfSongId)
127           val _tmpArtistKey: String
128           _tmpArtistKey = _stmt.getText(_columnIndexOfArtistKey)
129           _value = Song(_tmpSongId,_tmpArtistKey)
130           _values.add(_value)
131         }
132         _result
133       } finally {
134         _stmt.close()
135       }
136     }
137   }
138 
139   public override fun getArtistSongCount(): Map<Artist, Int> {
140     val _sql: String = "SELECT Artist.*, COUNT(songId) as songCount FROM Artist JOIN Song ON Artist.artistId = Song.artistKey GROUP BY artistId"
141     return performBlocking(__db, true, false) { _connection ->
142       val _stmt: SQLiteStatement = _connection.prepare(_sql)
143       try {
144         val _columnIndexOfArtistId: Int = getColumnIndexOrThrow(_stmt, "artistId")
145         val _columnIndexOfSongCount: Int = getColumnIndexOrThrow(_stmt, "songCount")
146         val _result: MutableMap<Artist, Int> = LinkedHashMap<Artist, Int>()
147         while (_stmt.step()) {
148           val _key: Artist
149           val _tmpArtistId: String
150           _tmpArtistId = _stmt.getText(_columnIndexOfArtistId)
151           _key = Artist(_tmpArtistId)
152           if (_stmt.isNull(_columnIndexOfSongCount)) {
153             error("The column(s) of the map value object of type 'Int' are NULL but the map's value type argument expect it to be NON-NULL")
154           }
155           val _value: Int
156           val _tmp: Int
157           _tmp = _stmt.getLong(_columnIndexOfSongCount).toInt()
158           _value = _tmp
159           if (!_result.containsKey(_key)) {
160             _result.put(_key, _value)
161           }
162         }
163         _result
164       } finally {
165         _stmt.close()
166       }
167     }
168   }
169 
170   public override fun getArtistWithSongIds(): Map<Artist, List<String>> {
171     val _sql: String = "SELECT * FROM Artist JOIN Song ON Artist.artistId = Song.artistKey"
172     return performBlocking(__db, true, false) { _connection ->
173       val _stmt: SQLiteStatement = _connection.prepare(_sql)
174       try {
175         val _columnIndexOfArtistId: Int = getColumnIndexOrThrow(_stmt, "artistId")
176         val _columnIndexOfSongId: Int = getColumnIndexOrThrow(_stmt, "songId")
177         val _result: MutableMap<Artist, MutableList<String>> = LinkedHashMap<Artist, MutableList<String>>()
178         while (_stmt.step()) {
179           val _key: Artist
180           val _tmpArtistId: String
181           _tmpArtistId = _stmt.getText(_columnIndexOfArtistId)
182           _key = Artist(_tmpArtistId)
183           val _values: MutableList<String>
184           if (_result.containsKey(_key)) {
185             _values = _result.getValue(_key)
186           } else {
187             _values = mutableListOf()
188             _result.put(_key, _values)
189           }
190           if (_stmt.isNull(_columnIndexOfSongId)) {
191             continue
192           }
193           val _value: String
194           _value = _stmt.getText(_columnIndexOfSongId)
195           _values.add(_value)
196         }
197         _result
198       } finally {
199         _stmt.close()
200       }
201     }
202   }
203 
204   public companion object {
205     public fun getRequiredConverters(): List<KClass<*>> = emptyList()
206   }
207 }
208