We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
public Board get(int seq){ Board board = mapper.get(seq); addBoardData(board); return board; }
위와 같이 select된 board 데이터에 Optional을 아래와 같이 씌우면
public Optional<Board> get(int seq){ Board board = mapper.get(seq); addBoardData(board); return Optional.ofNullable(board); }
BoardController에서 boardservice.get(..) 할때 아래와 같이 사용하면 된다
Board board = boardListService.get(num).orElseThrow(() -> new AlertBackException("게시글을 찾을 수 없습니다.", HttpServletResponse.SC_NOT_FOUND));