
1. ?로 쿼리를 완성하는 대신 :id 문법 적용





누르면 자동으로 업데이트 됨




버전 변경후 변동 사항
- 라이브러리가 JAVA → jakarta로 다 변경
- int로 치환하는 부분 number→long으로 바뀜

public int findBoardTotalCount() { Query query = em.createNativeQuery("select count(*) from board_tb"); Long boardTtalCount = (Long) query.getSingleResult(); return boardTtalCount.intValue(); }

Share article