Added SatItem and SatTrans relation to retrieve trans modes

This commit is contained in:
Arty Bishop committed 2021-03-26 08:40:28 +00:00
1 parent de11eb98c0
commit e8208b7934
3 files changed
+15 -18

No files matched your search

@@ -29,6 +29,7 @@ interface SatelliteDao {
// Query // Query
@Transaction
@Query("SELECT catNum, name, isSelected FROM entries ORDER BY name ASC") @Query("SELECT catNum, name, isSelected FROM entries ORDER BY name ASC")
fun getAllSatItems(): Flow<List<SatItem>> fun getAllSatItems(): Flow<List<SatItem>>
@@ -17,4 +17,17 @@
*/ */
package com.rtbishop.look4sat.data.model package com.rtbishop.look4sat.data.model
class SatItem(val catNum: Int, val name: String, var isSelected: Boolean) import androidx.room.Relation
data class SatItem(
val catNum: Int,
val name: String,
var isSelected: Boolean,
@Relation(
parentColumn = "catNum",
entity = SatTrans::class,
entityColumn = "catNum",
projection = ["mode"]
)
val modes: List<String>
)
@@ -1,20 +1,3 @@
/*
* Look4Sat. Amateur radio satellite tracker and pass predictor.
* Copyright (C) 2019-2021 Arty Bishop (bishop.arty@gmail.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/* /*
* Look4Sat. Amateur radio satellite tracker and pass predictor. * Look4Sat. Amateur radio satellite tracker and pass predictor.
* Copyright (C) 2019-2021 Arty Bishop (bishop.arty@gmail.com) * Copyright (C) 2019-2021 Arty Bishop (bishop.arty@gmail.com)