<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 com.google.common.collect.ImmutableMap
6 import javax.`annotation`.processing.Generated
7 import kotlin.Int
8 import kotlin.String
9 import kotlin.Suppress
10 import kotlin.collections.LinkedHashMap
11 import kotlin.collections.List
12 import kotlin.collections.MutableMap
13 import kotlin.reflect.KClass
14
15 @Generated(value = ["androidx.room.RoomProcessor"])
16 @Suppress(names = ["UNCHECKED_CAST", "DEPRECATION", "REDUNDANT_PROJECTION", "REMOVAL"])
17 public class MyDao_Impl(
18 __db: RoomDatabase,
19 ) : MyDao {
20 private val __db: RoomDatabase
21 init {
22 this.__db = __db
23 }
24
25 public override fun getSongsWithArtist(): ImmutableMap<Song, Artist> {
26 val _sql: String = "SELECT * FROM Song JOIN Artist ON Song.artistKey = Artist.artistId"
27 return performBlocking(__db, true, false) { _connection ->
28 val _stmt: SQLiteStatement = _connection.prepare(_sql)
29 try {
30 val _columnIndexOfSongId: Int = getColumnIndexOrThrow(_stmt, "songId")
31 val _columnIndexOfArtistKey: Int = getColumnIndexOrThrow(_stmt, "artistKey")
32 val _columnIndexOfArtistId: Int = getColumnIndexOrThrow(_stmt, "artistId")
33 val _mapResult: MutableMap<Song, Artist> = LinkedHashMap<Song, Artist>()
34 while (_stmt.step()) {
35 val _key: Song
36 val _tmpSongId: String
37 _tmpSongId = _stmt.getText(_columnIndexOfSongId)
38 val _tmpArtistKey: String
39 _tmpArtistKey = _stmt.getText(_columnIndexOfArtistKey)
40 _key = Song(_tmpSongId,_tmpArtistKey)
41 if (_stmt.isNull(_columnIndexOfArtistId)) {
42 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")
43 }
44 val _value: Artist
45 val _tmpArtistId: String
46 _tmpArtistId = _stmt.getText(_columnIndexOfArtistId)
47 _value = Artist(_tmpArtistId)
48 if (!_mapResult.containsKey(_key)) {
49 _mapResult.put(_key, _value)
50 }
51 }
52 val _result: ImmutableMap<Song, Artist> = ImmutableMap.copyOf(_mapResult)
53 _result
54 } finally {
55 _stmt.close()
56 }
57 }
58 }
59
60 public companion object {
61 public fun getRequiredConverters(): List<KClass<*>> = emptyList()
62 }
63 }
64