You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Edgar Gonzalez <eg...@valhallaproject.com> on 2002/01/07 22:59:00 UTC
Bug in BasePeer.createQueryString parsing the Criterions related to IsIgnoreCase?
Hi,
I think there is a bug in BasePeer.createQueryString when it parses the Criterions and the ignoreCase property is set.
In line 997 the code is:
---------------------------------------------------------------------------------------------------------------
boolean ignorCase = (criteria.isIgnoreCase() &&
(dbMap.getTable(table).getColumn(
someCriteria[i].getColumn()).getType() instanceof String));
someCriteria[i].setIgnoreCase(ignorCase);
---------------------------------------------------------------------------------------------------------------
This code ignore any previous value of someCriteria[i].isIgnoreCase(), and try to apply to all the Criterions the criteria.isIgnoreCase() value.
Suppose that I want a WHERE CLAUSE like this:
UPPER( TABLE_A.COLUMN_1 ) = UPPER('XXXX') AND TABLE_A.COLUMN_2 = 'yyyy'
Using criterions to do this with the current code it's impossible, because the criteria.isIgnoreCase() apply to both Criterions.
I think one possible workaround is to consider the previous value of someCriteria[i].isIgnoreCase(), something like:
boolean ignorCase = (someCriteria[i].isIgnoreCase() &&
Edgar