Hi,

I've committed the following changes to the cvs to solve some problems we had with the 
newest BasePeer class.

First, I got nullpointer exceptions when I tried to add new objects when I used the 
ID_TABLE and the new
setPrimaryKeyMethod() in MapBuilder.  The id is added to the Criteria object as a 
BigDecimal and therefore does not get
recognized correctly by BaseBeer. To fix this I:

1.  Added getBigDecimal() in Criteria
2.  Add the following to BasePeer's insertOrUpdateRecord() method
  else if ( obj instanceof BigDecimal)
      rec.setValue( colMap.getColumnName(), criteria.getBigDecimal(key) );

The other problem was with doDelete() in BasePeer.  The following code tried to 
retrieve a MapBuilder for the table
otherwise it used the default.
            try
            {
                // attempt to find the right DatabaseMap for the table that we
                // are currently working on. This allows for distributed DatabaseMap's
                // across several files.
                tempDbMap = DBBroker.getInstance().getDatabaseMap( tables.get(i) );
            }
            catch (Exception f)
            {
                tempDbMap = dbMap;
            }

The new DBBroker, however returns a new empty MapBuilder if it does not exist yet - 
resulting in a nullpointerexception.  My
solution (so far) is to only use the default MapBuilder.  I only put the code in 
comments in case somebody can come up with
a better solution :-)

~ Leon



------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to