Changeset View
Changeset View
Standalone View
Standalone View
GTFS_changes.diff
- This file was added.
diff --git a/src/it/reyboz/bustorino/data/gtfs/CsvTableInserter.kt b/src/it/reyboz/bustorino/data/gtfs/CsvTableInserter.kt | |||||
index 453630e..5f6e054 100644 | |||||
--- a/src/it/reyboz/bustorino/data/gtfs/CsvTableInserter.kt | |||||
+++ b/src/it/reyboz/bustorino/data/gtfs/CsvTableInserter.kt | |||||
@@ -19,13 +19,12 @@ package it.reyboz.bustorino.data.gtfs | |||||
import android.content.Context | |||||
import android.util.Log | |||||
-import java.util.ArrayList | |||||
class CsvTableInserter( | |||||
val tableName: String, context: Context | |||||
) { | |||||
private val database: GtfsDatabase = GtfsDatabase.getGtfsDatabase(context) | |||||
- private val dao: StaticGtfsDao = database.gtfsDao() | |||||
+ private val databaseDao: GtfsDBDao = database.gtfsDao() | |||||
private val elementsList: MutableList< in GtfsTable> = mutableListOf() | |||||
@@ -35,12 +34,12 @@ class CsvTableInserter( | |||||
private var countInsert = 0 | |||||
init { | |||||
if(tableName == "stop_times") { | |||||
- stopsIDsPresent = dao.getAllStopsIDs().toHashSet() | |||||
- tripsIDsPresent = dao.getAllTripsIDs().toHashSet() | |||||
+ stopsIDsPresent = databaseDao.getAllStopsIDs().toHashSet() | |||||
+ tripsIDsPresent = databaseDao.getAllTripsIDs().toHashSet() | |||||
Log.d(DEBUG_TAG, "num stop IDs present: "+ stopsIDsPresent!!.size) | |||||
Log.d(DEBUG_TAG, "num trips IDs present: "+ tripsIDsPresent!!.size) | |||||
} else if(tableName == "routes"){ | |||||
- dao.deleteAllRoutes() | |||||
+ databaseDao.deleteAllRoutes() | |||||
} | |||||
} | |||||
@@ -77,7 +76,7 @@ class CsvTableInserter( | |||||
//have to insert | |||||
if (tableName == "routes") | |||||
- dao.insertRoutes(elementsList.filterIsInstance<GtfsRoute>()) | |||||
+ databaseDao.insertRoutes(elementsList.filterIsInstance<GtfsRoute>()) | |||||
else | |||||
insertDataInDatabase() | |||||
@@ -90,21 +89,21 @@ class CsvTableInserter( | |||||
countInsert += elementsList.size | |||||
when(tableName){ | |||||
"stops" -> { | |||||
- dao.insertStops(elementsList.filterIsInstance<GtfsStop>()) | |||||
+ databaseDao.insertStops(elementsList.filterIsInstance<GtfsStop>()) | |||||
} | |||||
- "routes" -> dao.insertRoutes(elementsList.filterIsInstance<GtfsRoute>()) | |||||
- "calendar" -> dao.insertServices(elementsList.filterIsInstance<GtfsService>()) | |||||
- "calendar_dates" -> dao.insertDates(elementsList.filterIsInstance<GtfsServiceDate>()) | |||||
- "trips" -> dao.insertTrips(elementsList.filterIsInstance<GtfsTrip>()) | |||||
- "stop_times"-> dao.insertStopTimes(elementsList.filterIsInstance<GtfsStopTime>()) | |||||
- "shapes" -> dao.insertShapes(elementsList.filterIsInstance<GtfsShape>()) | |||||
+ "routes" -> databaseDao.insertRoutes(elementsList.filterIsInstance<GtfsRoute>()) | |||||
+ "calendar" -> databaseDao.insertServices(elementsList.filterIsInstance<GtfsService>()) | |||||
+ "calendar_dates" -> databaseDao.insertDates(elementsList.filterIsInstance<GtfsServiceDate>()) | |||||
+ "trips" -> databaseDao.insertTrips(elementsList.filterIsInstance<GtfsTrip>()) | |||||
+ "stop_times"-> databaseDao.insertStopTimes(elementsList.filterIsInstance<GtfsStopTime>()) | |||||
+ "shapes" -> databaseDao.insertShapes(elementsList.filterIsInstance<GtfsShape>()) | |||||
} | |||||
///if(elementsList.size < MAX_ELEMENTS) | |||||
} | |||||
fun finishInsert(){ | |||||
insertDataInDatabase() | |||||
- Log.d(DEBUG_TAG, "Inserted "+countInsert+" elements from "+tableName); | |||||
+ Log.d(DEBUG_TAG, "Inserted $countInsert elements from $tableName") | |||||
} | |||||
companion object{ | |||||
diff --git a/src/it/reyboz/bustorino/data/gtfs/GtfsAgency.kt b/src/it/reyboz/bustorino/data/gtfs/GtfsAgency.kt | |||||
new file mode 100644 | |||||
index 0000000..e53729a | |||||
--- /dev/null | |||||
+++ b/src/it/reyboz/bustorino/data/gtfs/GtfsAgency.kt | |||||
@@ -0,0 +1,55 @@ | |||||
+package it.reyboz.bustorino.data.gtfs | |||||
+ | |||||
+import androidx.room.ColumnInfo | |||||
+import androidx.room.Embedded | |||||
+import androidx.room.Entity | |||||
+import androidx.room.PrimaryKey | |||||
+ | |||||
+@Entity(tableName = GtfsAgency.TABLE_NAME) | |||||
+data class GtfsAgency( | |||||
+ @PrimaryKey | |||||
+ @ColumnInfo(name = COL_GTFS_ID) | |||||
+ val gtfsId: String, | |||||
+ @ColumnInfo(name = COL_NAME) | |||||
+ val name: String, | |||||
+ @ColumnInfo(name = COL_URL) | |||||
+ val url: String, | |||||
+ @ColumnInfo(name = COL_FAREURL) | |||||
+ val fareUrl: String?, | |||||
+ @ColumnInfo(name = COL_PHONE) | |||||
+ val phone: String?, | |||||
+ @Embedded var feed: GtfsFeed? | |||||
+): GtfsTable{ | |||||
+ constructor(valuesByColumn: Map<String,String>) : this( | |||||
+ valuesByColumn[COL_GTFS_ID]!!, | |||||
+ valuesByColumn[COL_NAME]!!, | |||||
+ valuesByColumn[COL_URL]!!, | |||||
+ valuesByColumn[COL_FAREURL], | |||||
+ valuesByColumn[COL_PHONE], | |||||
+ null | |||||
+ ) | |||||
+ | |||||
+ companion object{ | |||||
+ const val TABLE_NAME="gtfs_agencies" | |||||
+ | |||||
+ const val COL_GTFS_ID="gtfs_id" | |||||
+ const val COL_NAME="ag_name" | |||||
+ const val COL_URL="ag_url" | |||||
+ const val COL_FAREURL = "fare_url" | |||||
+ const val COL_PHONE = "phone" | |||||
+ | |||||
+ val COLUMNS = arrayOf( | |||||
+ COL_GTFS_ID, | |||||
+ COL_NAME, | |||||
+ COL_URL, | |||||
+ COL_FAREURL, | |||||
+ COL_PHONE | |||||
+ ) | |||||
+ const val CREATE_SQL = | |||||
+ "CREATE TABLE $TABLE_NAME ( $COL_GTFS_ID )" | |||||
+ } | |||||
+ | |||||
+ override fun getColumns(): Array<String> { | |||||
+ return COLUMNS | |||||
+ } | |||||
+} | |||||
diff --git a/src/it/reyboz/bustorino/data/gtfs/StaticGtfsDao.kt b/src/it/reyboz/bustorino/data/gtfs/GtfsDBDao.kt | |||||
similarity index 80% | |||||
rename from src/it/reyboz/bustorino/data/gtfs/StaticGtfsDao.kt | |||||
rename to src/it/reyboz/bustorino/data/gtfs/GtfsDBDao.kt | |||||
index 32f862c..5a00e74 100644 | |||||
--- a/src/it/reyboz/bustorino/data/gtfs/StaticGtfsDao.kt | |||||
+++ b/src/it/reyboz/bustorino/data/gtfs/GtfsDBDao.kt | |||||
@@ -21,8 +21,8 @@ import androidx.lifecycle.LiveData | |||||
import androidx.room.* | |||||
@Dao | |||||
-interface StaticGtfsDao { | |||||
- @Query("SELECT * FROM "+GtfsRoute.DB_TABLE+" ORDER BY "+GtfsRoute.COL_SORT_ORDER) | |||||
+interface GtfsDBDao { | |||||
+ @Query("SELECT * FROM "+GtfsRoute.DB_TABLE) | |||||
fun getAllRoutes() : LiveData<List<GtfsRoute>> | |||||
@Query("SELECT "+GtfsTrip.COL_TRIP_ID+" FROM "+GtfsTrip.DB_TABLE) | |||||
@@ -45,9 +45,9 @@ interface StaticGtfsDao { | |||||
deleteAllRoutes() | |||||
insertRoutes(routes) | |||||
} | |||||
- | |||||
+ @Transaction | |||||
@Insert(onConflict = OnConflictStrategy.REPLACE) | |||||
- fun insertRoutes(users: List<GtfsRoute>) | |||||
+ fun insertRoutes(routes: List<GtfsRoute>) | |||||
@Insert(onConflict = OnConflictStrategy.REPLACE) | |||||
fun insertStops(stops: List<GtfsStop>) | |||||
@Insert(onConflict = OnConflictStrategy.REPLACE) | |||||
@@ -87,4 +87,21 @@ interface StaticGtfsDao { | |||||
@Query("DELETE FROM "+GtfsService.DB_TABLE) | |||||
fun deleteAllServices() | |||||
+ @Insert(onConflict = OnConflictStrategy.REPLACE) | |||||
+ fun insertFeeds(feeds: List<GtfsFeed>) | |||||
+ | |||||
+ @Insert(onConflict = OnConflictStrategy.REPLACE) | |||||
+ fun insertAgencies(agencies: List<GtfsAgency>) | |||||
+ | |||||
+ @Transaction | |||||
+ fun insertAgenciesWithFeeds(feeds: List<GtfsFeed>, agencies: List<GtfsAgency>){ | |||||
+ insertFeeds(feeds) | |||||
+ insertAgencies(agencies) | |||||
+ } | |||||
+ | |||||
+ @Insert(onConflict = OnConflictStrategy.REPLACE) | |||||
+ fun insertPatterns(patterns: List<MatoPattern>) | |||||
+ | |||||
+ @Insert(onConflict = OnConflictStrategy.REPLACE) | |||||
+ fun insertPatternStops(patternStops: List<PatternStop>) | |||||
} | |||||
\ No newline at end of file | |||||
diff --git a/src/it/reyboz/bustorino/data/gtfs/GtfsDatabase.kt b/src/it/reyboz/bustorino/data/gtfs/GtfsDatabase.kt | |||||
index 986f01f..c6f19a7 100644 | |||||
--- a/src/it/reyboz/bustorino/data/gtfs/GtfsDatabase.kt | |||||
+++ b/src/it/reyboz/bustorino/data/gtfs/GtfsDatabase.kt | |||||
@@ -22,20 +22,24 @@ import androidx.room.* | |||||
@Database( | |||||
entities = [ | |||||
+ GtfsFeed::class, | |||||
+ GtfsAgency::class, | |||||
GtfsServiceDate::class, | |||||
GtfsStop::class, | |||||
GtfsService::class, | |||||
GtfsRoute::class, | |||||
GtfsStopTime::class, | |||||
GtfsTrip::class, | |||||
- GtfsShape::class], | |||||
+ GtfsShape::class, | |||||
+ MatoPattern::class, | |||||
+ PatternStop::class | |||||
+ ], | |||||
version = GtfsDatabase.VERSION, | |||||
- exportSchema = false, | |||||
) | |||||
@TypeConverters(Converters::class) | |||||
-public abstract class GtfsDatabase : RoomDatabase() { | |||||
+abstract class GtfsDatabase : RoomDatabase() { | |||||
- abstract fun gtfsDao() : StaticGtfsDao | |||||
+ abstract fun gtfsDao() : GtfsDBDao | |||||
companion object{ | |||||
@Volatile | |||||
@@ -51,7 +55,13 @@ public abstract class GtfsDatabase : RoomDatabase() { | |||||
} | |||||
} | |||||
- const val VERSION = 1 | |||||
+ const val VERSION = 2 | |||||
const val FOREIGNKEY_ONDELETE = ForeignKey.CASCADE | |||||
+ | |||||
+ /*val MIGRATION_1_2 = Migration(1,2) { | |||||
+ TODO("Have to write it") //it.execSQL() | |||||
+ } | |||||
+ | |||||
+ */ | |||||
} | |||||
} | |||||
\ No newline at end of file | |||||
diff --git a/src/it/reyboz/bustorino/data/gtfs/GtfsFeed.kt b/src/it/reyboz/bustorino/data/gtfs/GtfsFeed.kt | |||||
new file mode 100644 | |||||
index 0000000..8105fa6 | |||||
--- /dev/null | |||||
+++ b/src/it/reyboz/bustorino/data/gtfs/GtfsFeed.kt | |||||
@@ -0,0 +1,50 @@ | |||||
+/* | |||||
+ BusTO - Data components | |||||
+ Copyright (C) 2022 Fabio Mazza | |||||
+ | |||||
+ 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 <http://www.gnu.org/licenses/>. | |||||
+ */ | |||||
+package it.reyboz.bustorino.data.gtfs | |||||
+ | |||||
+import androidx.room.ColumnInfo | |||||
+import androidx.room.Entity | |||||
+import androidx.room.PrimaryKey | |||||
+ | |||||
+@Entity(tableName = GtfsFeed.TABLE_NAME) | |||||
+data class GtfsFeed( | |||||
+ @PrimaryKey | |||||
+ @ColumnInfo(name = COL_GTFS_ID) | |||||
+ val gtfsId: String, | |||||
+): GtfsTable{ | |||||
+ constructor(valuesByColumn: Map<String,String>) : this( | |||||
+ valuesByColumn[COL_GTFS_ID]!!, | |||||
+ ) | |||||
+ | |||||
+ companion object{ | |||||
+ const val TABLE_NAME="gtfs_feeds" | |||||
+ | |||||
+ const val COL_GTFS_ID="feed_id" | |||||
+ | |||||
+ | |||||
+ val COLUMNS = arrayOf( | |||||
+ COL_GTFS_ID, | |||||
+ ) | |||||
+ const val CREATE_SQL = | |||||
+ "CREATE TABLE $TABLE_NAME ( $COL_GTFS_ID )" | |||||
+ } | |||||
+ | |||||
+ override fun getColumns(): Array<String> { | |||||
+ return COLUMNS | |||||
+ } | |||||
+} | |||||
diff --git a/src/it/reyboz/bustorino/data/gtfs/GtfsMode.kt b/src/it/reyboz/bustorino/data/gtfs/GtfsMode.kt | |||||
new file mode 100644 | |||||
index 0000000..a9b7f2a | |||||
--- /dev/null | |||||
+++ b/src/it/reyboz/bustorino/data/gtfs/GtfsMode.kt | |||||
@@ -0,0 +1,19 @@ | |||||
+package it.reyboz.bustorino.data.gtfs | |||||
+ | |||||
+enum class GtfsMode(val intType: Int) { | |||||
+ TRAM(0), | |||||
+ SUBWAY(1), | |||||
+ RAIL(2), | |||||
+ BUS(3), | |||||
+ FERRY(4), | |||||
+ CABLE_TRAM(5), | |||||
+ GONDOLA(6), | |||||
+ FUNICULAR(7), | |||||
+ TROLLEYBUS(11), | |||||
+ MONORAIL(12); | |||||
+ | |||||
+ companion object { | |||||
+ private val VALUES = values() | |||||
+ fun getByValue(value: Int) = VALUES.firstOrNull { it.intType == value } | |||||
+ } | |||||
+} | |||||
\ No newline at end of file | |||||
diff --git a/src/it/reyboz/bustorino/data/gtfs/GtfsRoute.kt b/src/it/reyboz/bustorino/data/gtfs/GtfsRoute.kt | |||||
index fef6167..fa39e16 100644 | |||||
--- a/src/it/reyboz/bustorino/data/gtfs/GtfsRoute.kt | |||||
+++ b/src/it/reyboz/bustorino/data/gtfs/GtfsRoute.kt | |||||
@@ -23,26 +23,25 @@ import androidx.room.PrimaryKey | |||||
@Entity(tableName=GtfsRoute.DB_TABLE) | |||||
data class GtfsRoute( | |||||
- @PrimaryKey @ColumnInfo(name = COL_ROUTE_ID) | |||||
- val ID: String, | |||||
- @ColumnInfo(name = "agency_id") | |||||
+ @PrimaryKey @ColumnInfo(name = COL_ROUTE_ID) | |||||
+ val gtfsId: String, | |||||
+ @ColumnInfo(name = "agency_id") | |||||
val agencyID: String, | |||||
- @ColumnInfo(name = "route_short_name") | |||||
+ @ColumnInfo(name = "route_short_name") | |||||
val shortName: String, | |||||
- @ColumnInfo(name = "route_long_name") | |||||
+ @ColumnInfo(name = "route_long_name") | |||||
val longName: String, | |||||
- @ColumnInfo(name = "route_desc") | |||||
+ @ColumnInfo(name = "route_desc") | |||||
val description: String, | |||||
- @ColumnInfo(name ="route_type") | |||||
- val type: String, | |||||
+ @ColumnInfo(name = COL_MODE) | |||||
+ val mode: GtfsMode, | |||||
//@ColumnInfo(name ="route_url") | |||||
//val url: String, | |||||
- @ColumnInfo(name ="route_color") | |||||
+ @ColumnInfo(name = COL_COLOR) | |||||
val color: String, | |||||
- @ColumnInfo(name ="route_text_color") | |||||
+ @ColumnInfo(name = COL_TEXT_COLOR) | |||||
val textColor: String, | |||||
- @ColumnInfo(name = COL_SORT_ORDER) | |||||
- val sortOrder: Int | |||||
+ | |||||
): GtfsTable { | |||||
constructor(valuesByColumn: Map<String,String>) : this( | |||||
@@ -51,15 +50,17 @@ data class GtfsRoute( | |||||
valuesByColumn["route_short_name"]!!, | |||||
valuesByColumn["route_long_name"]!!, | |||||
valuesByColumn["route_desc"]!!, | |||||
- valuesByColumn["route_type"]!!, | |||||
- valuesByColumn["route_color"]!!, | |||||
- valuesByColumn["route_text_color"]!!, | |||||
- valuesByColumn[COL_SORT_ORDER]?.toInt()!! | |||||
+ valuesByColumn["route_type"]?.toInt()?.let { GtfsMode.getByValue(it) }!!, | |||||
+ valuesByColumn[COL_COLOR]!!, | |||||
+ valuesByColumn[COL_TEXT_COLOR]!!, | |||||
) | |||||
companion object { | |||||
const val DB_TABLE: String="routes_table" | |||||
const val COL_SORT_ORDER: String="route_sort_order" | |||||
const val COL_ROUTE_ID = "route_id" | |||||
+ const val COL_MODE ="route_mode" | |||||
+ const val COL_COLOR="route_color" | |||||
+ const val COL_TEXT_COLOR="route_text_color" | |||||
val COLUMNS = arrayOf(COL_ROUTE_ID, | |||||
"agency_id", | |||||
diff --git a/src/it/reyboz/bustorino/data/gtfs/MatoPattern.kt b/src/it/reyboz/bustorino/data/gtfs/MatoPattern.kt | |||||
new file mode 100644 | |||||
index 0000000..83a0bb5 | |||||
--- /dev/null | |||||
+++ b/src/it/reyboz/bustorino/data/gtfs/MatoPattern.kt | |||||
@@ -0,0 +1,111 @@ | |||||
+/* | |||||
+ BusTO - Data components | |||||
+ Copyright (C) 2022 Fabio Mazza | |||||
+ | |||||
+ 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 <http://www.gnu.org/licenses/>. | |||||
+ */ | |||||
+package it.reyboz.bustorino.data.gtfs | |||||
+ | |||||
+import androidx.room.ColumnInfo | |||||
+import androidx.room.Entity | |||||
+import androidx.room.Ignore | |||||
+import androidx.room.PrimaryKey | |||||
+import it.reyboz.bustorino.backend.Stop | |||||
+ | |||||
+@Entity(tableName = MatoPattern.TABLE_NAME) | |||||
+data class MatoPattern( | |||||
+ @ColumnInfo(name= COL_NAME) | |||||
+ val name: String, | |||||
+ @ColumnInfo(name= COL_CODE) | |||||
+ @PrimaryKey | |||||
+ val code: String, | |||||
+ @ColumnInfo(name= COL_SEMANTIC_HASH) | |||||
+ val semanticHash: String, | |||||
+ @ColumnInfo(name= COL_DIRECTION_ID) | |||||
+ val directionId: Int, | |||||
+ @ColumnInfo(name= COL_ROUTE_ID) | |||||
+ val routeGtfsId: String, | |||||
+ @ColumnInfo(name= COL_HEADSIGN) | |||||
+ var headsign: String?, | |||||
+ @ColumnInfo(name= COL_GEOMETRY_POLY) | |||||
+ val patternGeometryPoly: String, | |||||
+ @ColumnInfo(name= COL_GEOMETRY_LENGTH) | |||||
+ val patternGeometryLength: Int, | |||||
+ @Ignore | |||||
+ val stopsGtfsIDs: ArrayList<String> | |||||
+ | |||||
+):GtfsTable{ | |||||
+ | |||||
+ @Ignore | |||||
+ val servingStops= ArrayList<Stop>(4) | |||||
+ constructor( | |||||
+ name: String, code:String, | |||||
+ semanticHash: String, directionId: Int, | |||||
+ routeGtfsId: String, headsign: String?, | |||||
+ patternGeometryPoly: String, patternGeometryLength: Int | |||||
+ ): this(name, code, semanticHash, directionId, routeGtfsId, headsign, patternGeometryPoly, patternGeometryLength, ArrayList<String>(4)) | |||||
+ | |||||
+ companion object{ | |||||
+ const val TABLE_NAME="mato_patterns" | |||||
+ | |||||
+ const val COL_NAME="pattern_name" | |||||
+ const val COL_CODE="pattern_code" | |||||
+ const val COL_ROUTE_ID="pattern_route_id" | |||||
+ const val COL_SEMANTIC_HASH="pattern_hash" | |||||
+ const val COL_DIRECTION_ID="pattern_direction_id" | |||||
+ const val COL_HEADSIGN="pattern_headsign" | |||||
+ const val COL_GEOMETRY_POLY="pattern_polyline" | |||||
+ const val COL_GEOMETRY_LENGTH="pattern_polylength" | |||||
+ | |||||
+ val COLUMNS = arrayOf( | |||||
+ COL_NAME, | |||||
+ COL_CODE, | |||||
+ COL_ROUTE_ID, | |||||
+ COL_SEMANTIC_HASH, | |||||
+ COL_DIRECTION_ID, | |||||
+ COL_HEADSIGN, | |||||
+ COL_GEOMETRY_POLY, | |||||
+ COL_GEOMETRY_LENGTH | |||||
+ ) | |||||
+ } | |||||
+ override fun getColumns(): Array<String> { | |||||
+ return COLUMNS | |||||
+ } | |||||
+} | |||||
+ | |||||
+//DO NOT USE EMBEDDED!!! -> copies all data | |||||
+ | |||||
+@Entity(tableName=PatternStop.TABLE_NAME, | |||||
+ primaryKeys = [ | |||||
+ PatternStop.COL_PATTERN_ID, | |||||
+ PatternStop.COL_STOP_GTFS, | |||||
+ PatternStop.COL_ORDER | |||||
+ ] | |||||
+) | |||||
+data class PatternStop( | |||||
+ @ColumnInfo(name= COL_PATTERN_ID) | |||||
+ val patternId: String, | |||||
+ @ColumnInfo(name=COL_STOP_GTFS) | |||||
+ val stopGtfsId: String, | |||||
+ @ColumnInfo(name=COL_ORDER) | |||||
+ val order: Int, | |||||
+){ | |||||
+ companion object{ | |||||
+ const val TABLE_NAME="patterns_stops" | |||||
+ | |||||
+ const val COL_PATTERN_ID="pattern_gtfs_id" | |||||
+ const val COL_STOP_GTFS="stop_gtfs_id" | |||||
+ const val COL_ORDER="stop_order" | |||||
+ } | |||||
+} | |||||
\ No newline at end of file |
Public contents are in Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) or GNU Free Documentation License (at your option) unless otherwise noted. · Contact / Register