Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- http://localhost:8080/books.getBooksByGenre/Документальное/0/10
- http://localhost:8080/books.getBooksByGenre/%D0%94%D0%BE%D0%BA%D1%83%D0%BC%D0%B5%D0%BD%D1%82%D0%B0%D0%BB%D1%8C%D0%BD%D0%BE%D0%B5/0/10
- override fun findGenreByName(genreName: String): DatabaseGenre {
- return transaction(db) { getGenreByName(genreName) }
- }
- private fun getGenreByName(genreName: String): DatabaseGenre {
- return try {
- val foundGenre = GenreEntity.find { Genres.genre eq genreName }.single()
- DatabaseGenre(foundGenre.id.value, foundGenre.genre, foundGenre.link)
- } catch (e: Exception) {
- throw NothingFoundInDatabaseException("no one genre found by '$genreName'")
- } catch (e: NoSuchElementException) {
- val m = "Duplicates of genre with name '$genreName'"
- throw DuplicatedDataInDatabaseException(m)
- }
- }
- java.util.NoSuchElementException: Collection is empty.
- SELECT genres.id, genres.genre, genres.link FROM genres WHERE genres.genre = 'Документальное'
- SELECT genres.id, genres.genre, genres.link FROM genres WHERE genres.genre = 'simpleGenre'
Add Comment
Please, Sign In to add comment