// 从 JDBC ResultSet 获取 Key
Object key = JdbcUtils.getResultSetValue(rs, keyColumnIndex, keyType);
if (key != null && !keyType.isInstance(key)) {
ResultSetMetaData rsmd = rs.getMetaData();
throw new TypeMismatchDataAccessException( // NL
"Type mismatch affecting row number " + rowNum + " and column type '"
+ rsmd.getColumnTypeName(keyColumnIndex) + "' expected type is '"
+ keyType + "'");
}
// 从 JDBC ResultSet 获取 Value
Object value = JdbcUtils.getResultSetValue(rs, valueColumnIndex, valueType);
if (value != null && !valueType.isInstance(value)) {
ResultSetMetaData rsmd = rs.getMetaData();
throw new TypeMismatchDataAccessException( // NL
"Type mismatch affecting row number " + rowNum + " and column type '"
+ rsmd.getColumnTypeName(valueColumnIndex) + "' expected type is '"
+ valueType + "'");
}