Notice
Recent Posts
Recent Comments
Link
12-22 14:48
«   2025/12   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
Archives
Today
Total
관리 메뉴

study-project

[오류]attempted to return null from a method with a primitive return type (int). 본문

TIL/Spring

[오류]attempted to return null from a method with a primitive return type (int).

귤식빵 2021. 4. 3. 00:28

이것도 한참 찾았던 오류이다. 

게시판에서 리스트의 페이징 하려고 전체 게시글의 수를 count 해서 리턴하는 sql을 만들다가 생긴 오류

mapper의 resuresultType을 체크해야한다.

count를 할 때 null이 발생하는 경우가 있는데 int는 null을 매핑 할 수 없다고 한다 

그래서 integer타입으로 변경하였다.

Comments