root layout

패스트캠퍼스

  1. 강의 질문
  2. 개발/데이터

part1. jpa실습에서

2025.06.04 19:29 작성

commentRepositoryImpl에서 save구현할때


@Overridepublic Comment save(Comment comment) {        CommentEntity commentEntity = new CommentEntity(comment);    if (comment.getId() != null) {        jpaCommentRepository.updateCommentEntity(commentEntity);        return comment;    }    commentEntity = jpaCommentRepository.save(commentEntity);    return commentEntity.toComment();}
이렇게 하셨는데


중간 if절에서의 return값은 return commentEntity.toComment();

가되야하지않나용??

답변 

연관 질문

커뮤니티 질문보기