Computer/Spring Maven MyBatis
eGovFrame bound mismatch the generic method sort(list <t> ) of type collections is not applicable
미처서
2015. 11. 20. 00:54
eGovFrame 01.실행환경_실습교제(공통기반)
이 문제를 진행하다보면 XMLEmpDAO의 소스에서 Collections부분의 에러를 확인할 수 있다.
Bound mismatch : the generic method sort(list <t> ) of type collections is not applicable....
이는 콜렉션프레임워크에서 정렬을 할 때 각 원소간 크기를 비교해야하는데 그 기준을 정의하지 않아서 발생하는에러이다.
이 에러를 해결하기 위해선 객체를 정의할 때 Comparable을 implement 한 뒤 정의 하면 된다.