elifbilgin | 3c46fef73 | 2023-06-22 14:15:12 -0700 | [diff] [blame^] | 1 | import android.database.Cursor |
| 2 | import androidx.room.RoomDatabase |
| 3 | import androidx.room.RoomSQLiteQuery |
| 4 | import androidx.room.RoomSQLiteQuery.Companion.acquire |
| 5 | import androidx.room.util.getColumnIndexOrThrow |
| 6 | import androidx.room.util.query |
| 7 | import java.lang.Class |
| 8 | import java.util.ArrayList |
| 9 | import java.util.LinkedHashMap |
| 10 | import javax.`annotation`.processing.Generated |
| 11 | import kotlin.Int |
| 12 | import kotlin.String |
| 13 | import kotlin.Suppress |
| 14 | import kotlin.collections.List |
| 15 | import kotlin.collections.Map |
| 16 | import kotlin.collections.MutableList |
| 17 | import kotlin.collections.MutableMap |
| 18 | import kotlin.jvm.JvmStatic |
| 19 | |
| 20 | @Generated(value = ["androidx.room.RoomProcessor"]) |
| 21 | @Suppress(names = ["UNCHECKED_CAST", "DEPRECATION", "REDUNDANT_PROJECTION"]) |
| 22 | public class MyDao_Impl( |
| 23 | __db: RoomDatabase, |
| 24 | ) : MyDao { |
| 25 | private val __db: RoomDatabase |
| 26 | init { |
| 27 | this.__db = __db |
| 28 | } |
| 29 | |
| 30 | public override fun singleNested(): Map<Artist, Map<Album, List<Song>>> { |
| 31 | val _sql: String = |
| 32 | "SELECT * FROM Artist JOIN (Album JOIN Song ON Album.albumName = Song.album) ON Artist.artistName = Album.albumArtist" |
| 33 | val _statement: RoomSQLiteQuery = acquire(_sql, 0) |
| 34 | __db.assertNotSuspendingTransaction() |
| 35 | val _cursor: Cursor = query(__db, _statement, false, null) |
| 36 | try { |
| 37 | val _cursorIndexOfArtistId: Int = getColumnIndexOrThrow(_cursor, "artistId") |
| 38 | val _cursorIndexOfArtistName: Int = getColumnIndexOrThrow(_cursor, "artistName") |
| 39 | val _cursorIndexOfAlbumId: Int = getColumnIndexOrThrow(_cursor, "albumId") |
| 40 | val _cursorIndexOfAlbumName: Int = getColumnIndexOrThrow(_cursor, "albumName") |
| 41 | val _cursorIndexOfAlbumArtist: Int = getColumnIndexOrThrow(_cursor, "albumArtist") |
| 42 | val _cursorIndexOfSongId: Int = getColumnIndexOrThrow(_cursor, "songId") |
| 43 | val _cursorIndexOfAlbum: Int = getColumnIndexOrThrow(_cursor, "album") |
| 44 | val _cursorIndexOfSongArtist: Int = getColumnIndexOrThrow(_cursor, "songArtist") |
| 45 | val _result: MutableMap<Artist, MutableMap<Album, MutableList<Song>>> = |
| 46 | LinkedHashMap<Artist, MutableMap<Album, MutableList<Song>>>() |
| 47 | while (_cursor.moveToNext()) { |
| 48 | val _key: Artist |
| 49 | val _tmpArtistId: String |
| 50 | _tmpArtistId = _cursor.getString(_cursorIndexOfArtistId) |
| 51 | val _tmpArtistName: String |
| 52 | _tmpArtistName = _cursor.getString(_cursorIndexOfArtistName) |
| 53 | _key = Artist(_tmpArtistId,_tmpArtistName) |
| 54 | val _values: MutableMap<Album, MutableList<Song>> |
| 55 | if (_result.containsKey(_key)) { |
| 56 | _values = _result.getValue(_key) |
| 57 | } else { |
| 58 | _values = LinkedHashMap<Album, MutableList<Song>>() |
| 59 | _result.put(_key, _values) |
| 60 | } |
| 61 | if (_cursor.isNull(_cursorIndexOfAlbumId) && _cursor.isNull(_cursorIndexOfAlbumName) && |
| 62 | _cursor.isNull(_cursorIndexOfAlbumArtist)) { |
| 63 | continue |
| 64 | } |
| 65 | val _key_1: Album |
| 66 | val _tmpAlbumId: String |
| 67 | _tmpAlbumId = _cursor.getString(_cursorIndexOfAlbumId) |
| 68 | val _tmpAlbumName: String |
| 69 | _tmpAlbumName = _cursor.getString(_cursorIndexOfAlbumName) |
| 70 | val _tmpAlbumArtist: String |
| 71 | _tmpAlbumArtist = _cursor.getString(_cursorIndexOfAlbumArtist) |
| 72 | _key_1 = Album(_tmpAlbumId,_tmpAlbumName,_tmpAlbumArtist) |
| 73 | val _values_1: MutableList<Song> |
| 74 | if (_values.containsKey(_key_1)) { |
| 75 | _values_1 = _values.getValue(_key_1) |
| 76 | } else { |
| 77 | _values_1 = ArrayList<Song>() |
| 78 | _values.put(_key_1, _values_1) |
| 79 | } |
| 80 | if (_cursor.isNull(_cursorIndexOfSongId) && _cursor.isNull(_cursorIndexOfAlbum) && |
| 81 | _cursor.isNull(_cursorIndexOfSongArtist)) { |
| 82 | continue |
| 83 | } |
| 84 | val _value: Song |
| 85 | val _tmpSongId: String |
| 86 | _tmpSongId = _cursor.getString(_cursorIndexOfSongId) |
| 87 | val _tmpAlbum: String |
| 88 | _tmpAlbum = _cursor.getString(_cursorIndexOfAlbum) |
| 89 | val _tmpSongArtist: String |
| 90 | _tmpSongArtist = _cursor.getString(_cursorIndexOfSongArtist) |
| 91 | _value = Song(_tmpSongId,_tmpAlbum,_tmpSongArtist) |
| 92 | _values_1.add(_value) |
| 93 | } |
| 94 | return _result |
| 95 | } finally { |
| 96 | _cursor.close() |
| 97 | _statement.release() |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | public override fun doubleNested(): Map<Playlist, Map<Artist, Map<Album, List<Song>>>> { |
| 102 | val _sql: String = |
| 103 | "SELECT * FROM Playlist JOIN (Artist JOIN (Album JOIN Song ON Album.albumName = Song.album) ON Artist.artistName = Album.albumArtist)ON Playlist.playlistArtist = Artist.artistName" |
| 104 | val _statement: RoomSQLiteQuery = acquire(_sql, 0) |
| 105 | __db.assertNotSuspendingTransaction() |
| 106 | val _cursor: Cursor = query(__db, _statement, false, null) |
| 107 | try { |
| 108 | val _cursorIndexOfPlaylistId: Int = getColumnIndexOrThrow(_cursor, "playlistId") |
| 109 | val _cursorIndexOfPlaylistArtist: Int = getColumnIndexOrThrow(_cursor, "playlistArtist") |
| 110 | val _cursorIndexOfArtistId: Int = getColumnIndexOrThrow(_cursor, "artistId") |
| 111 | val _cursorIndexOfArtistName: Int = getColumnIndexOrThrow(_cursor, "artistName") |
| 112 | val _cursorIndexOfAlbumId: Int = getColumnIndexOrThrow(_cursor, "albumId") |
| 113 | val _cursorIndexOfAlbumName: Int = getColumnIndexOrThrow(_cursor, "albumName") |
| 114 | val _cursorIndexOfAlbumArtist: Int = getColumnIndexOrThrow(_cursor, "albumArtist") |
| 115 | val _cursorIndexOfSongId: Int = getColumnIndexOrThrow(_cursor, "songId") |
| 116 | val _cursorIndexOfAlbum: Int = getColumnIndexOrThrow(_cursor, "album") |
| 117 | val _cursorIndexOfSongArtist: Int = getColumnIndexOrThrow(_cursor, "songArtist") |
| 118 | val _result: MutableMap<Playlist, MutableMap<Artist, MutableMap<Album, MutableList<Song>>>> = |
| 119 | LinkedHashMap<Playlist, MutableMap<Artist, MutableMap<Album, MutableList<Song>>>>() |
| 120 | while (_cursor.moveToNext()) { |
| 121 | val _key: Playlist |
| 122 | val _tmpPlaylistId: String |
| 123 | _tmpPlaylistId = _cursor.getString(_cursorIndexOfPlaylistId) |
| 124 | val _tmpPlaylistArtist: String |
| 125 | _tmpPlaylistArtist = _cursor.getString(_cursorIndexOfPlaylistArtist) |
| 126 | _key = Playlist(_tmpPlaylistId,_tmpPlaylistArtist) |
| 127 | val _values: MutableMap<Artist, MutableMap<Album, MutableList<Song>>> |
| 128 | if (_result.containsKey(_key)) { |
| 129 | _values = _result.getValue(_key) |
| 130 | } else { |
| 131 | _values = LinkedHashMap<Artist, MutableMap<Album, MutableList<Song>>>() |
| 132 | _result.put(_key, _values) |
| 133 | } |
| 134 | if (_cursor.isNull(_cursorIndexOfArtistId) && _cursor.isNull(_cursorIndexOfArtistName)) { |
| 135 | continue |
| 136 | } |
| 137 | val _key_1: Artist |
| 138 | val _tmpArtistId: String |
| 139 | _tmpArtistId = _cursor.getString(_cursorIndexOfArtistId) |
| 140 | val _tmpArtistName: String |
| 141 | _tmpArtistName = _cursor.getString(_cursorIndexOfArtistName) |
| 142 | _key_1 = Artist(_tmpArtistId,_tmpArtistName) |
| 143 | val _values_1: MutableMap<Album, MutableList<Song>> |
| 144 | if (_values.containsKey(_key_1)) { |
| 145 | _values_1 = _values.getValue(_key_1) |
| 146 | } else { |
| 147 | _values_1 = LinkedHashMap<Album, MutableList<Song>>() |
| 148 | _values.put(_key_1, _values_1) |
| 149 | } |
| 150 | if (_cursor.isNull(_cursorIndexOfAlbumId) && _cursor.isNull(_cursorIndexOfAlbumName) && |
| 151 | _cursor.isNull(_cursorIndexOfAlbumArtist)) { |
| 152 | continue |
| 153 | } |
| 154 | val _key_2: Album |
| 155 | val _tmpAlbumId: String |
| 156 | _tmpAlbumId = _cursor.getString(_cursorIndexOfAlbumId) |
| 157 | val _tmpAlbumName: String |
| 158 | _tmpAlbumName = _cursor.getString(_cursorIndexOfAlbumName) |
| 159 | val _tmpAlbumArtist: String |
| 160 | _tmpAlbumArtist = _cursor.getString(_cursorIndexOfAlbumArtist) |
| 161 | _key_2 = Album(_tmpAlbumId,_tmpAlbumName,_tmpAlbumArtist) |
| 162 | val _values_2: MutableList<Song> |
| 163 | if (_values_1.containsKey(_key_2)) { |
| 164 | _values_2 = _values_1.getValue(_key_2) |
| 165 | } else { |
| 166 | _values_2 = ArrayList<Song>() |
| 167 | _values_1.put(_key_2, _values_2) |
| 168 | } |
| 169 | if (_cursor.isNull(_cursorIndexOfSongId) && _cursor.isNull(_cursorIndexOfAlbum) && |
| 170 | _cursor.isNull(_cursorIndexOfSongArtist)) { |
| 171 | continue |
| 172 | } |
| 173 | val _value: Song |
| 174 | val _tmpSongId: String |
| 175 | _tmpSongId = _cursor.getString(_cursorIndexOfSongId) |
| 176 | val _tmpAlbum: String |
| 177 | _tmpAlbum = _cursor.getString(_cursorIndexOfAlbum) |
| 178 | val _tmpSongArtist: String |
| 179 | _tmpSongArtist = _cursor.getString(_cursorIndexOfSongArtist) |
| 180 | _value = Song(_tmpSongId,_tmpAlbum,_tmpSongArtist) |
| 181 | _values_2.add(_value) |
| 182 | } |
| 183 | return _result |
| 184 | } finally { |
| 185 | _cursor.close() |
| 186 | _statement.release() |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | public companion object { |
| 191 | @JvmStatic |
| 192 | public fun getRequiredConverters(): List<Class<*>> = emptyList() |
| 193 | } |
| 194 | } |