Skip to content

Instantly share code, notes, and snippets.

@yole
Created August 25, 2015 14:53
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 yole/efc439e2c2ab11cce6ac to your computer and use it in GitHub Desktop.
Save yole/efc439e2c2ab11cce6ac to your computer and use it in GitHub Desktop.
Exposed micro-sample
object CountryTable : IdTable() {
val iso = varchar("iso", 2).uniqueIndex()
val name = varchar("name", 250).uniqueIndex()
}
public class Country(id: EntityID) : Entity(id) {
var name: String by CountryTable.name
var iso: String by CountryTable.iso
}
val russia = Country.find { CountryTable.iso.eq("ru") }.firstOrNull()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment