IT'S DO
article thumbnail
Published 2022. 8. 10. 18:02
jpa 배열로 넣기 개발/JPA
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);
}

굿

profile

IT'S DO

@멋진놈

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!