コード例 #1
0
 @Override
 public List<CommentDTO> getCommentList() throws Exception {
   List<CommentDTO> commentList = new ArrayList<>();
   List<CommentModel> results = commentDAO.getCommentList();
   for (CommentModel commentModel : results) {
     CommentDTO commentDTO = new CommentDTO();
     commentDTO.setCommentId(commentModel.getCommentId());
     commentDTO.setAuthor(commentModel.getAuthor());
     commentDTO.setText(commentModel.getText());
     commentList.add(commentDTO);
   }
   return commentList;
 }