ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Ellis <ellis....@gmail.com>
Subject Re: Case sensitivity in DefaultResultSetHandler
Date Mon, 05 Oct 2009 11:02:41 GMT
You'll have seen the JIRA emails, but for the list archives, link is:

http://issues.apache.org/jira/browse/IBATIS-668

Cheers
Martin


On Sun, Oct 4, 2009 at 10:38 PM, Clinton Begin <clinton.begin@gmail.com> wrote:
> And if you have a patch, you can attach it to the Jira ticket.
>
> On Sun, Oct 4, 2009 at 2:41 PM, Martin Ellis <ellis.m.a@gmail.com> wrote:
>>
>> On Fri, Oct 2, 2009 at 9:40 PM, Clinton Begin <clinton.begin@gmail.com>
>> wrote:
>> > Unfortunately, by coincidence, I'm currently rewriting the entire
>> > DefaultResultSetHandler -- in a serious way.  It's currently in a real
>> > state
>> > of flux.
>> > I'll work on it this weekend some more to try to get it to a Beta 4.
>> >  Your
>> > feedback will come in handy for sure.
>>
>> I can see a number of commits from this weekend - seems you have been
>> busy!
>>
>> However, from reviewing the changes, it looks as though I'll still
>> have the problems I described: loadMappedAndUnmappedColumnNames adding
>> mixed case column names to a list, and applyPropertyMappings searching
>> for the upper-cased name.
>>
>> The only case sensitivity issues I saw addressed affected SqlRunner.
>> I'll check tomorrow to be sure, though.
>>
>> Cheers
>> Martin
>>
>>
>> > On Fri, Oct 2, 2009 at 12:56 PM, Martin Ellis <martin@ellis.name>
>> >> There
>> >> seems to be a case sensitivity issue in
>> >> DefaultResultSetHandler#getRowValue().
>> >>
>> >> It calls loadMappedAndUnmappedColumnNames, which
>> >> populates two lists with (uncapitalised) column names.
>> >> This is then passed to applyPropertyMappings, which
>> >> searches the same lists for upper-cased column names:
>> >>
>> >>   if (propertyMapping.isCompositeResult()
>> >>     || (column != null &&
>> >> mappedColumnNames.contains(column.toUpperCase()))) {
>> >>
>> >>
>> >> I've got stuff working as I'd like with the following change:
>> >>
>> >> ---
>> >>
>> >> a/ibatis-3-core/src/main/java/org/apache/ibatis/executor/resultset/DefaultResultSetHandler.java
>> >> +++
>> >>
>> >> b/ibatis-3-core/src/main/java/org/apache/ibatis/executor/resultset/DefaultResultSetHandler.java
>> >> @@ -265,9 +265,9 @@ public class DefaultResultSetHandler implements
>> >> ResultSetHandler {
>> >>       final String columnName = configuration.isUseColumnLabel() ?
>> >> rsmd.getColumnLabel(i) : rsmd.getColumnName(i);
>> >>       final String upperColumnName = columnName.toUpperCase();
>> >>       if (mappedColumns.contains(upperColumnName)) {
>> >> -        mappedColumnNames.add(columnName);
>> >> +        mappedColumnNames.add(upperColumnName);
>> >>       } else {
>> >> -        unmappedColumnNames.add(columnName);
>> >> +        unmappedColumnNames.add(upperColumnName);
>> >>       }
>> >>     }
>> >>   }
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
>> For additional commands, e-mail: user-java-help@ibatis.apache.org
>>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Mime
View raw message