[ http://nagoya.apache.org/jira/browse/IBATIS-21?page=comments#action_56265 ] Harold Neiper commented on IBATIS-21: -------------------------------------
ok, last debug info - i am outputting the class types for the values in the map created from the result map. Please notice the second to last key [_userId] value type difference. On the solaris deployment it is picking up the jdbcType="string" for that column. locally: ........output the key and value types for userMap........ _userSecToken=1 --> class java.lang.String _userPassword=spongebob --> class java.lang.String _userName=TESTUSER --> class java.lang.String _userAuthInfoId=21 --> class java.math.BigDecimal _userId=1 --> class java.math.BigDecimal _userValidFlag=Y --> class java.lang.String solaris: ........output the key and value types for userMap........ _userSecToken=1 --> class java.lang.String _userPassword=spongebob --> class java.lang.String _userName=TESTUSER --> class java.lang.String _userAuthInfoId=21 --> class java.math.BigDecimal _userId=1 --> class java.lang.String _userValidFlag=Y --> class java.lang.String > Fixed JDBC types being ignored for hashmap result map > ----------------------------------------------------- > > Key: IBATIS-21 > URL: http://nagoya.apache.org/jira/browse/IBATIS-21 > Project: iBatis for Java > Type: Bug > Components: SQL Maps > Versions: 2.0.8 > Environment: JDK 1.4, Tomcat 5.0.27, Spring 1.1, Oracle 9i > Reporter: Harold Neiper > > I am populating a Map instance [HashMap] and trying to set the java type for > the return value of the first column in my result map. The column type in > the DB is Number and is currently returning as java type BigDecimal. > However, I would prefer that it be set to a String type in my result map. > In the developer guide the javaType is listed as optional. However, it is > unclear as to whether these options are only available for Result Maps that > are mapping to JavaBean properities or for the likes of all types of Result > Maps (in this case a Map instance). > Here is my result map below: > <resultMap id="authenticatedUserResult" class="java.util.HashMap"> > <result property="_userId" column="app_user_objid" > javaType="string"/> > <result property="_userAuthInfoId" > column="app_user_auth_info_objid"/> > <result property="_userName" column="user_id"/> > <result property="_userPassword" column="encrypted_pwd_txt"/> > <result property="_userValidFlag" column="valid_flag"/> > </resultMap> > Here is the mapped statement: > <select id="getAuthenticatedUser" > parameterClass="java.util.Map" > resultMap="authenticatedUserResult"> > select au.app_user_objid > , auai.app_user_auth_info_objid > , au.user_id > , auai.encrypted_pwd_txt > , auai.valid_flag > from app_user au > , app_user_auth_info auai > where au.user_id = #_userName# > and auai.app_user_fk = au.app_user_objid > </select> > And the dao code: > public Map getAuthenticatedUser(Map userMap) > throws DataAccessException { > > return (HashMap) > getSqlMapClientTemplate().queryForObject(SQL_MAP_GET_AUTHENTICATED_USER, > userMap); > } > thx - harold -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://nagoya.apache.org/jira/secure/Administrators.jspa - If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira