src/main/kotlin/de/uapcore/lightpit/dao/postgres/PGIssueDao.kt

changeset 164
003b08bb3f25
parent 159
86b5d8a1662f
equal deleted inserted replaced
163:a5b9632729b6 164:003b08bb3f25
91 ) 91 )
92 private val listComments = connection.prepareStatement( 92 private val listComments = connection.prepareStatement(
93 "select * from lpit_issue_comment left join lpit_user using (userid) where issueid = ? order by created" 93 "select * from lpit_issue_comment left join lpit_user using (userid) where issueid = ? order by created"
94 ) 94 )
95 95
96 private val updateIssueLastModified = connection.prepareStatement(
97 "update lpit_issue set updated = now() where issueid = ?"
98 );
99
96 override fun mapResult(rs: ResultSet): Issue { 100 override fun mapResult(rs: ResultSet): Issue {
97 val project = Project(rs.getInt("project")) 101 val project = Project(rs.getInt("project"))
98 project.name = rs.getString("projectname") 102 project.name = rs.getString("projectname")
99 project.node = rs.getString("projectnode") 103 project.node = rs.getString("projectnode")
100 val issue = Issue(rs.getInt("issueid")) 104 val issue = Issue(rs.getInt("issueid"))
243 insertComment.setInt(1, issue.id) 247 insertComment.setInt(1, issue.id)
244 insertComment.setString(2, comment.comment) 248 insertComment.setString(2, comment.comment)
245 setForeignKeyOrNull(insertComment, 3, comment.author, User::id) 249 setForeignKeyOrNull(insertComment, 3, comment.author, User::id)
246 insertComment.execute() 250 insertComment.execute()
247 } 251 }
252 updateIssueLastModified.setInt(1, issue.id);
253 updateIssueLastModified.execute();
248 } 254 }
249 } 255 }

mercurial