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/09 22:05:52 UTC
REPOST: Is this bug in BasePeer.createQueryString()
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() &&
any comment or suggestion?
Thanks in advance
Edgar
Re: REPOST: Is this bug in BasePeer.createQueryString()
Posted by Edgar Gonzalez <eg...@valhallaproject.com>.
Thanks Scott
Edgar
----- Original Message -----
From: "Scott Eade" <se...@backstagetech.com.au>
To: "Turbine Users List" <tu...@jakarta.apache.org>
Sent: Thursday, January 10, 2002 11:11 AM
Subject: Re: REPOST: Is this bug in BasePeer.createQueryString()
> From: "Edgar Gonzalez" <eg...@valhallaproject.com>
> > I have a tested patch, how I submit it?
>
> You could chack the mail archive - this question has been
> asked before.
>
> Basically you need to prduce a diff as per
> http://jakarta.apache.org/site/source.html
> and mail it to the turbine-dev list with [PATCH]
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: REPOST: Is this bug in BasePeer.createQueryString()
Posted by Scott Eade <se...@backstagetech.com.au>.
From: "Edgar Gonzalez" <eg...@valhallaproject.com>
> I have a tested patch, how I submit it?
You could chack the mail archive - this question has been
asked before.
Basically you need to prduce a diff as per
http://jakarta.apache.org/site/source.html
and mail it to the turbine-dev list with [PATCH]
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: REPOST: Is this bug in BasePeer.createQueryString()
Posted by Edgar Gonzalez <eg...@valhallaproject.com>.
John,
I have a tested patch, how I submit it?
----------------------------------------------------------------------------
Edgar Gonzalez Gonzalez
VALHALLA Project, s.a.
Chief Technology Officer
Web: www.valhallaproject.com
E-mail: egg@valhallaproject.com
Phone: +58-212-242.4379 / 6662 / 4055 / 6475
Fax: +58-212-242.6809
"The limits of my language mean the limits of my world."
Ludwig Wittgenstein
----------------------------------------------------------------------------
----- Original Message -----
From: "John McNally" <jm...@collab.net>
To: "Turbine Users List" <tu...@jakarta.apache.org>
Sent: Wednesday, January 09, 2002 7:51 PM
Subject: Re: REPOST: Is this bug in BasePeer.createQueryString()
> Please submit a patch that you have tested.
>
> john mcnally
>
> Edgar Gonzalez wrote:
> >
> > 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() &&
> >
> > any comment or suggestion?
> >
> > Thanks in advance
> >
> > Edgar
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: REPOST: Is this bug in BasePeer.createQueryString()
Posted by John McNally <jm...@collab.net>.
Please submit a patch that you have tested.
john mcnally
Edgar Gonzalez wrote:
>
> 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() &&
>
> any comment or suggestion?
>
> Thanks in advance
>
> Edgar
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>