You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Age Mooy <am...@home.nl> on 2001/03/06 21:45:21 UTC

[Patch] BasePeer.java

I'm using the newish OR functionality in Criteria to do a keyword search over many columns in a few linked tables. This worked fine
until I wanted to ignore the case of the columns I was checking. After setting ignoreCase to true in Criteria, I got a nice null
pointer from BasePeer.

It seems that the code that checks for ignoreCase expects that all Criterions linked by AND or OR use the same column name that was
used to add the root Criterion to the Criteria, which is not correct. The column name of the relevant Criterion should be used.

I haven't set up my WinCVS to connect to the Turbine CVS server but I did do a local filesystem diff. I hope it's enough. I'm
talking about line 933 in BasePeer.java.

Age

===================================================
bash-2.04$ diff -u BasePeer.java BasePeer2.java
--- BasePeer.java       Tue Mar  6 16:05:18 2001
+++ BasePeer2.java      Tue Mar  6 16:15:34 2001
@@ -930,7 +930,7 @@

                 boolean ignorCase = (criteria.isIgnoreCase() &&
                     (dbMap.getTable(table).getColumn(
-                    criteria.getColumnName(key)).getType() instanceof String));
+                    someCriteria[i].getColumn()).getType() instanceof String));

                 someCriteria[i].setIgnoreCase(ignorCase);
             }



Re: [Patch] BasePeer.java

Posted by John McNally <jm...@collab.net>.
The patch has been applied.

Thanks,
John McNally

Age Mooy wrote:
> 
> I'm using the newish OR functionality in Criteria to do a keyword search over many columns in a few linked tables. This worked fine
> until I wanted to ignore the case of the columns I was checking. After setting ignoreCase to true in Criteria, I got a nice null
> pointer from BasePeer.
> 
> It seems that the code that checks for ignoreCase expects that all Criterions linked by AND or OR use the same column name that was
> used to add the root Criterion to the Criteria, which is not correct. The column name of the relevant Criterion should be used.
> 
> I haven't set up my WinCVS to connect to the Turbine CVS server but I did do a local filesystem diff. I hope it's enough. I'm
> talking about line 933 in BasePeer.java.
> 
> Age
> 
> ===================================================
> bash-2.04$ diff -u BasePeer.java BasePeer2.java
> --- BasePeer.java       Tue Mar  6 16:05:18 2001
> +++ BasePeer2.java      Tue Mar  6 16:15:34 2001
> @@ -930,7 +930,7 @@
> 
>                  boolean ignorCase = (criteria.isIgnoreCase() &&
>                      (dbMap.getTable(table).getColumn(
> -                    criteria.getColumnName(key)).getType() instanceof String));
> +                    someCriteria[i].getColumn()).getType() instanceof String));
> 
>                  someCriteria[i].setIgnoreCase(ignorCase);
>              }
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org