1.1 --- a/src/main/java/de/uapcore/lightpit/dao/postgres/PGIssueDao.java Fri Oct 23 18:40:50 2020 +0200 1.2 +++ b/src/main/java/de/uapcore/lightpit/dao/postgres/PGIssueDao.java Fri Oct 23 20:34:57 2020 +0200 1.3 @@ -275,7 +275,7 @@ 1.4 List<IssueComment> comments = new ArrayList<>(); 1.5 try (var result = listComments.executeQuery()) { 1.6 while (result.next()) { 1.7 - final var comment = new IssueComment(result.getInt("commentid"), issue); 1.8 + final var comment = new IssueComment(result.getInt("commentid")); 1.9 comment.setCreated(result.getTimestamp("created")); 1.10 comment.setUpdated(result.getTimestamp("updated")); 1.11 comment.setUpdateCount(result.getInt("updatecount")); 1.12 @@ -288,15 +288,13 @@ 1.13 } 1.14 1.15 @Override 1.16 - public void saveComment(IssueComment comment) throws SQLException { 1.17 - Objects.requireNonNull(comment.getComment()); 1.18 - Objects.requireNonNull(comment.getIssue()); 1.19 + public void saveComment(Issue issue, IssueComment comment) throws SQLException { 1.20 if (comment.getId() >= 0) { 1.21 updateComment.setString(1, comment.getComment()); 1.22 updateComment.setInt(2, comment.getId()); 1.23 updateComment.execute(); 1.24 } else { 1.25 - insertComment.setInt(1, comment.getIssue().getId()); 1.26 + insertComment.setInt(1, issue.getId()); 1.27 insertComment.setString(2, comment.getComment()); 1.28 setForeignKeyOrNull(insertComment, 3, comment.getAuthor(), User::getId); 1.29 insertComment.execute();