Comment라는 엔티티를 부모와 자식 상속관계로 구현한다.
commentResponseDto.getCommentId() = 1
commentResponseDto.getContent() = 댓글1
commentResponseDto.getParentId() = null
child.getContent() = 답글1
commentResponseDto.getCommentId() = 2
commentResponseDto.getContent() = 답글1
commentResponseDto.getParentId() = 1
child.getContent() = 답글1의 답글1
commentResponseDto.getCommentId() = 3
commentResponseDto.getContent() = 답글1의 답글1
commentResponseDto.getParentId() = 2
'프로젝트 > SpringBoot Side Project' 카테고리의 다른 글
트러블 슈팅 : 구글 로그인 인증(Google Auth) 승인 오류 403 오류( access_denied) (0) | 2024.01.26 |
---|---|
트러블 슈팅 : JPA leftjoin N+1 문제 (0) | 2024.01.24 |
spring security에서 로그인 한 사용자의 권한 체크용 간단한 코드 (0) | 2024.01.18 |
Elastic Beanstalk 서버 시간 변경 (0) | 2023.12.21 |
트러블슈팅 (0) | 2023.12.14 |