You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by "Folkens, Brad" <BF...@vil.downers-grove.il.us> on 2003/12/17 17:27:04 UTC

NullPointerException in BasePeer doUpdate and doDelete thrown fro m com.workingdogs.village.Value

To all who are interested,

For a while now I've been having problems with the BasePeer class in Torque
with TDK 2.3.  I have a table with a column (BLOB) in Oracle and I've left
it out of the column defs during the Torque generation (because of
Oracle-JDBC incompatibilities in the default BLOB handling).

What I've noticed though, is that I start getting lots of problems with
BasePeer trying to initialize null village.Value objects.  Turns out
BasePeer calls village's TableDataSet initializer without the column
specifications - don't know if that's intentional or not.  So this patch
forces only the columns in the initial criteria passed to doDelete and
doUpdate to be fed to the TableDataSet initializer.

Hope this helps some if you've had similar issues with Torque.

Brad


(In retrospect, this should probably be on the torque lists, but since it's
such a part of the Turbine stuff I figured I'd post here)

 
Index: BasePeer.java
===================================================================
retrieving revision 1.76
diff -r1.76 BasePeer.java
530a531
>             StringBuffer columns = new StringBuffer(); 
541a543,547
> 
>                 columns.append(key);
>                 if(j < columnMaps.length-1)
>                  columns.append(',');
>                 
564c570
<                 tds = new TableDataSet(con, tab, kd);
---
>                 tds = new TableDataSet(con, tab, columns.toString(), kd);
1888a1895
>             StringBuffer columns = new StringBuffer(); 
1899a1907,1911
>                 
>                 columns.append(key);
>                 if(j < columnMaps.length-1)
>                  columns.append(',');
>                 
1924c1936
<                 tds = new TableDataSet(con, tab, kd);
---
>                 tds = new TableDataSet(con, tab, columns.toString(), kd);