DJ메탈짱™의 Free Style

부적합한 열이름, #AutoResultMap, #iBatis, #remapResults 본문

일(job)/JAVA

부적합한 열이름, #AutoResultMap, #iBatis, #remapResults

뽀&쏭 2016. 1. 22. 17:40

 
org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0];
--- The error occurred in sqlmap/promotion/CcPromAplyInfo.xml.
--- The error occurred while applying a result map.
--- Check the CcPromAplyInfo.getCcPromAplyInfoGoods-AutoResultMap.
--- Check the result mapping for the 'PAGEIDX' property.
--- Cause: com.pionnet.exception.CommonSqlException: java.sql.SQLException: 부적합한 열 이름; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in sqlmap/promotion/CcPromAplyInfo.xml.
--- The error occurred while applying a result map.
--- Check the CcPromAplyInfo.getCcPromAplyInfoGoods-AutoResultMap.
--- Check the result mapping for the 'PAGEIDX' property.
--- Cause: com.pionnet.exception.CommonSqlException: java.sql.SQLException: 부적합한 열 이름
   at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83)
   at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
   at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
   at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:212)
   at org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithListResult(SqlMapClientTemplate.java:249)
        ..........................................

와 같은 오류가 발생하는데.... 항상 발생하는게 아니라 어쩌다가? 문득? 에러가 발생하더이다.

검색을 해본 결과. iBatis의 캐쉬?로 인한 문제.

이럴 때는 <select .... 에 remapResults="true"> 속성을 추가해주면 해결됨.


출처 : http://azurecourse.tistory.com/entry/The-error-occurred-while-applying-a-result-map