Ejemplo n.º 1
0
 @Override
 public void editComment(Comment comment) {
   jdbcTemplate.update(
       SQL_UPDATE_COMMENT,
       comment.getPostId(),
       comment.getUserName(),
       comment.getEmail(),
       comment.getCommentText(),
       comment.getCommentDate(),
       comment.isCommentPublish(),
       comment.getCommentId());
 }
Ejemplo n.º 2
0
 @Override
 public Comment addComment(Comment comment) {
   jdbcTemplate.update(
       SQL_INSERT_COMMENT,
       comment.getPostId(),
       comment.getUserName(),
       comment.getEmail(),
       comment.getCommentText(),
       comment.getCommentDate());
   comment.setCommentId(jdbcTemplate.queryForObject("select LAST_INSERT_ID()", Integer.class));
   return comment;
 }