blob: 7e67d4e42b8009aea49f3f32d5ab32a6e82a19b7 [file] [log] [blame]
elifbilgin4c097272022-11-22 16:15:47 -08001import android.database.Cursor
2import androidx.room.RoomDatabase
3import androidx.room.RoomSQLiteQuery
4import androidx.room.RoomSQLiteQuery.Companion.acquire
5import androidx.room.util.getColumnIndexOrThrow
6import androidx.room.util.query
7import com.google.common.collect.ImmutableMap
8import java.lang.Class
9import java.util.LinkedHashMap
10import javax.`annotation`.processing.Generated
11import kotlin.Int
12import kotlin.String
13import kotlin.Suppress
14import kotlin.collections.List
15import kotlin.collections.MutableMap
16import kotlin.jvm.JvmStatic
17
18@Generated(value = ["androidx.room.RoomProcessor"])
elifbilgind46e8c12023-01-17 09:32:11 -080019@Suppress(names = ["UNCHECKED_CAST", "DEPRECATION", "REDUNDANT_PROJECTION"])
elifbilgin4c097272022-11-22 16:15:47 -080020public class MyDao_Impl(
21 __db: RoomDatabase,
22) : MyDao {
23 private val __db: RoomDatabase
24 init {
25 this.__db = __db
26 }
27
28 public override fun getSongsWithArtist(): ImmutableMap<Song, Artist> {
29 val _sql: String = "SELECT * FROM Song JOIN Artist ON Song.artistKey = Artist.artistId"
30 val _statement: RoomSQLiteQuery = acquire(_sql, 0)
31 __db.assertNotSuspendingTransaction()
32 val _cursor: Cursor = query(__db, _statement, false, null)
33 try {
34 val _cursorIndexOfSongId: Int = getColumnIndexOrThrow(_cursor, "songId")
35 val _cursorIndexOfArtistKey: Int = getColumnIndexOrThrow(_cursor, "artistKey")
36 val _cursorIndexOfArtistId: Int = getColumnIndexOrThrow(_cursor, "artistId")
37 val _mapResult: MutableMap<Song, Artist> = LinkedHashMap<Song, Artist>()
38 while (_cursor.moveToNext()) {
39 val _key: Song
40 val _tmpSongId: String
41 _tmpSongId = _cursor.getString(_cursorIndexOfSongId)
42 val _tmpArtistKey: String
43 _tmpArtistKey = _cursor.getString(_cursorIndexOfArtistKey)
44 _key = Song(_tmpSongId,_tmpArtistKey)
45 if (_cursor.isNull(_cursorIndexOfArtistId)) {
elifbilgin22935ce2023-07-25 14:14:10 -070046 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")
elifbilgin4c097272022-11-22 16:15:47 -080047 }
48 val _value: Artist
49 val _tmpArtistId: String
50 _tmpArtistId = _cursor.getString(_cursorIndexOfArtistId)
51 _value = Artist(_tmpArtistId)
52 if (!_mapResult.containsKey(_key)) {
53 _mapResult.put(_key, _value)
54 }
55 }
56 val _result: ImmutableMap<Song, Artist> = ImmutableMap.copyOf(_mapResult)
57 return _result
58 } finally {
59 _cursor.close()
60 _statement.release()
61 }
62 }
63
64 public companion object {
65 @JvmStatic
66 public fun getRequiredConverters(): List<Class<*>> = emptyList()
67 }
68}