Created
February 17, 2019 17:50
-
-
Save juancho088/478ddbb94f9ff336303b9bef43484e64 to your computer and use it in GitHub Desktop.
Kotlin Exposed DAO example
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
// CREATE | |
val movie = StarWarsFilm.new { | |
name = "The Last Jedi" | |
sequelId = 8 | |
director = "Rian Johnson" | |
} | |
// READ | |
val movies = StarWarsFilm.all() | |
val movies = StarWarsFilm.find { StarWarsFilms.sequelId eq 8 } | |
val movie = StarWarsFilm.findById(5) | |
// UPDATE | |
movie.name = "Episode VIII – The Last Jedi" | |
// DELETE | |
movie.delete() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment