Last active
March 11, 2020 18:52
-
-
Save motorro/39d70721ac11eebde6bdd26fc442d4f6 to your computer and use it in GitHub Desktop.
City entity definition
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* City entity | |
*/ | |
@Entity( | |
tableName = "cities", | |
indices = [ | |
Index(name = "city_name", value = ["name"]) | |
] | |
) | |
data class City( | |
@PrimaryKey | |
val id: Int, | |
val name: String, | |
val state: String?, | |
val country: CountryCode, | |
@Embedded | |
val coord: Coord | |
) | |
/** | |
* Coordinates | |
*/ | |
data class Coord(val lat: Double, val lon: Double) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment