Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Not A Problem
-
3.0 Beta 10
-
None
-
None
Description
In 'Configuration.xml' file, I set <setting name="useColumnLabel" value="false" />
AND:
public interface BoundCompanyMapper {
...
@Select("SELECT engalias as test_alias FROM company where company_id = #
")
Company findCompany(String companyId);
...
}
Would cause result set get column by name Exception:
---------------------------------------------------------------------------
Caused by: java.sql.SQLException: Column 'ENGALIAS' not found.
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1056)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)
at com.mysql.jdbc.ResultSetImpl.findColumn(ResultSetImpl.java:1080)
at com.mysql.jdbc.ResultSetImpl.getString(ResultSetImpl.java:5474)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.ibatis.logging.jdbc.ResultSetLogger.invoke(ResultSetLogger.java:31)
at $Proxy14.getString(Unknown Source)
at org.apache.ibatis.type.StringTypeHandler.getNullableResult(StringTypeHandler.java:17)
at org.apache.ibatis.type.BaseTypeHandler.getResult(BaseTypeHandler.java:24)
at org.apache.ibatis.executor.resultset.FastResultSetHandler.applyAutomaticMappings(FastResultSetHandler.java:238)
at org.apache.ibatis.executor.resultset.FastResultSetHandler.getRowValue(FastResultSetHandler.java:181)
at org.apache.ibatis.executor.resultset.FastResultSetHandler.handleRowValues(FastResultSetHandler.java:134)
at org.apache.ibatis.executor.resultset.FastResultSetHandler.handleResultSet(FastResultSetHandler.java:110)
at org.apache.ibatis.executor.resultset.FastResultSetHandler.handleResultSets(FastResultSetHandler.java:100)
at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:40)
at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:55)
at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:41)
at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:90)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:68)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:59)
... 30 more
The result name column name is' test_alias', but it why to use 'ENGALIAS" retrieve data ?
(ResultSet.getString("'ENGALIAS") ?)
---------------------------------------------------
It is global setting effect if I use <setting name="useColumnLabel" value="false" />