You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by "Reuben Firmin (JIRA)" <ib...@incubator.apache.org> on 2005/11/07 22:56:20 UTC
[jira] Commented: (IBATIS-210) Enum within Collection is not mapped to custom TypeHandler
[ http://issues.apache.org/jira/browse/IBATIS-210?page=comments#action_12356983 ]
Reuben Firmin commented on IBATIS-210:
--------------------------------------
Here is the stacktrace. I have reproduced on 2.1.6
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1768)
at com.ibatis.common.beans.BaseProbe.getIndexedProperty(BaseProbe.java:50)
at com.ibatis.common.beans.GenericProbe.getObject(GenericProbe.java:56)
at com.ibatis.sqlmap.engine.exchange.ListDataExchange.getData(ListDataExchange.java:63)
at com.ibatis.sqlmap.engine.exchange.BaseDataExchange.getCacheKey(BaseDataExchange.java:35)
at com.ibatis.sqlmap.engine.mapping.parameter.BasicParameterMap.getCacheKey(BasicParameterMap.java:136)
at com.ibatis.sqlmap.engine.mapping.statement.BaseStatement.getCacheKey(BaseStatement.java:113)
at com.ibatis.sqlmap.engine.mapping.statement.CachingStatement.getCacheKey(CachingStatement.java:115)
at com.ibatis.sqlmap.engine.mapping.statement.CachingStatement.executeQueryForList(CachingStatement.java:89)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:610)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:584)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:101)
at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:78)
at org.springframework.orm.ibatis.SqlMapClientTemplate$3.doInSqlMapClient(SqlMapClientTemplate.java:245)
at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:165)
at org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithListResult(SqlMapClientTemplate.java:204)
at org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList(SqlMapClientTemplate.java:243)
> Enum within Collection is not mapped to custom TypeHandler
> ----------------------------------------------------------
>
> Key: IBATIS-210
> URL: http://issues.apache.org/jira/browse/IBATIS-210
> Project: iBatis for Java
> Type: Bug
> Components: SQL Maps
> Versions: 2.1.0
> Environment: Linux/Spring/Resin/Jdk1.5
> Reporter: Reuben Firmin
>
> Passing an Enum to Ibatis requires the declaration of a custom TypeHandler (see my comments here for my implementation: http://opensource2.atlassian.com/confluence/oss/display/IBATIS/How%20do%20I%20use%20a%20Custom%20Type%20Handler%20with%20complex%20property%20or%20Type%20Safe%20Enumeration)
> This works, except when the Enum is within a map or a list.
> That is, if I pass a list of Enum attributes to a statement, as a parameter, and attempt to iterate over them, they are mapped to UnknownTypeHandler. Similarly, when an Enum is passed as value in a HashMap as part of a parameter, it is also mapped to an UnknownTypeHandler.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira