Skip to content

Instantly share code, notes, and snippets.

@motorro
Last active March 11, 2020 18:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save motorro/39d70721ac11eebde6bdd26fc442d4f6 to your computer and use it in GitHub Desktop.
Save motorro/39d70721ac11eebde6bdd26fc442d4f6 to your computer and use it in GitHub Desktop.
City entity definition
/**
* 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