diff -r fe4de34822a5 -r 479dd7993ef9 src/main/kotlin/de/uapcore/lightpit/dao/PostgresDataAccessObject.kt --- a/src/main/kotlin/de/uapcore/lightpit/dao/PostgresDataAccessObject.kt Mon Aug 02 15:13:04 2021 +0200 +++ b/src/main/kotlin/de/uapcore/lightpit/dao/PostgresDataAccessObject.kt Mon Aug 02 17:04:17 2021 +0200 @@ -658,6 +658,12 @@ queryAll { it.extractIssueComment() } } + override fun findComment(id: Int): IssueComment? = + withStatement("select * from lpit_issue_comment left join lpit_user using (userid) where commentid = ?") { + setInt(1, id) + querySingle { it.extractIssueComment() } + } + override fun insertComment(issueComment: IssueComment) { useStatement("update lpit_issue set updated = now() where issueid = ?") { updateIssueDate -> withStatement("insert into lpit_issue_comment (issueid, comment, userid) values (?, ? ,?)") { @@ -672,5 +678,19 @@ } } } + + override fun updateComment(issueComment: IssueComment) { + useStatement("update lpit_issue set updated = now() where issueid = ?") { updateIssueDate -> + withStatement("update lpit_issue_comment set comment = ?, updatecount = updatecount + 1, updated = now() where commentid = ?") { + with(issueComment) { + updateIssueDate.setInt(1, issueid) + setStringSafe(1, comment) + setInt(2, id) + } + executeUpdate() + updateIssueDate.executeUpdate() + } + } + } // } \ No newline at end of file