Skip to content

Instantly share code, notes, and snippets.

@yole
Created August 25, 2015 14:53
Show Gist options
  • 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