Author: cbegin Date: Sat Feb 13 03:05:18 2010 New Revision: 909701 URL: http://svn.apache.org/viewvc?rev=909701&view=rev Log: Improved error message on missing parameter typehandler
Modified: ibatis/java/ibatis-3/trunk/ibatis-3-core/src/main/java/org/apache/ibatis/executor/resultset/FastResultSetHandler.java Modified: ibatis/java/ibatis-3/trunk/ibatis-3-core/src/main/java/org/apache/ibatis/executor/resultset/FastResultSetHandler.java URL: http://svn.apache.org/viewvc/ibatis/java/ibatis-3/trunk/ibatis-3-core/src/main/java/org/apache/ibatis/executor/resultset/FastResultSetHandler.java?rev=909701&r1=909700&r2=909701&view=diff ============================================================================== --- ibatis/java/ibatis-3/trunk/ibatis-3-core/src/main/java/org/apache/ibatis/executor/resultset/FastResultSetHandler.java (original) +++ ibatis/java/ibatis-3/trunk/ibatis-3-core/src/main/java/org/apache/ibatis/executor/resultset/FastResultSetHandler.java Sat Feb 13 03:05:18 2010 @@ -61,7 +61,12 @@ if ("java.sql.ResultSet".equalsIgnoreCase(parameterMapping.getJavaType().getName())) { handleRefCursorOutputParameter(cs, parameterMapping, i, metaParam); } else { - metaParam.setValue(parameterMapping.getProperty(), parameterMapping.getTypeHandler().getResult(cs, i + 1)); + final TypeHandler typeHandler = parameterMapping.getTypeHandler(); + if (typeHandler == null) { + throw new ExecutorException("Type handler was null on parameter mapping for property " + parameterMapping.getProperty() + ". " + + "It was either not specified and/or could not be found for the javaType / jdbcType combination specified."); + } + metaParam.setValue(parameterMapping.getProperty(), typeHandler.getResult(cs, i + 1)); } } }