-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Матвеева Виктория: HW with DataBase #152
base: lecture07
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Две транзакции (см комментарии)
- Мало тестов
- Остальное хорошо
- Всегда думай как можно написать меньше кода не теряя читабельность
} | ||
|
||
override fun findById(id: Int): Message? { | ||
val resultRow = transaction { Messages.select { Messages.id eq id }.firstOrNull() } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
val resultRow = transaction { Messages.select { Messages.id eq id }.firstOrNull() } | |
val resultRow = transaction { Messages.select { Messages.id eq id }.firstOrNull() } ?: return |
и дальше с nn работаешь
val resultRow = transaction { Messages.select { Messages.id eq id }.firstOrNull() } | ||
return resultRow?.let { Message( | ||
resultRow[Messages.id], | ||
UserDao().findById(resultRow[Messages.user])!!, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
этот вызов будет в другой транзакции - что делать?
class MessageDaoTest { | ||
|
||
@Test | ||
fun `add massage`() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а можешь этот typo fix отдельным PR добавить? )
No description provided.