728x90
@Transactional
public List<RevisionResponseDto> selectViewCode(final Long eventId) throws Exception {
List<Revision> list = revisionRepository.selectViewCode(eventId);
return list.stream().map(RevisionResponseDto::new).collect(Collectors.toList());
}
List<RevisionResponseDto> selectViewCode(final Long eventId) throws Exception;
@Query(value = "SELECT * from Revision where event_id = :id", nativeQuery = true)
List<Revision> selectViewCode(Long id);
@GetMapping("/v3/revision/{eventId}")
public List<RevisionResponseDto> findById(@PathVariable final Long eventId) throws Exception {
return revisionService.selectViewCode(eventId);
}
굿
'개발 > JPA' 카테고리의 다른 글
JPA String 필요한 제공 타입 TIL 에러 좋은 정보 나중에 안될 때 확인 (0) | 2022.08.12 |
---|---|
jpa 게시판 권한 기능 구현 필요한 샘플 (0) | 2022.08.11 |
JPA 중요한 것 조인 칼럼을 쓸려면 (0) | 2022.08.10 |
일단 확인 해야겠지만. 값 담을 때 쓰는 법 (0) | 2022.08.01 |
(2) error-api - 전역 예외 처리(Global Exception Handling) & 로그백(logback-spring.xml) 적용하기 초기 설정 할 때 중요 작업 (0) | 2022.07.29 |