Tom,

Yes it does. In the tables MapBulder class it has the following:

dbMap = Torque.getDatabaseMap("default");
dbMap.addTable("PMTEM021_POLOFFR");
TableMap tMap = dbMap.getTable("PMTEM021_POLOFFR");
tMap.setPrimaryKeyMethod("none");
tMap.addPrimaryKey("PMTEM021_POLOFFR.OFFRG_N", new String());

                                                                                
  
                                                                                
  
 Jim Caserta                                                                    
  
                                                                                
  
 Whitehouse Station CCI - PM&M Systems                                          
  
                                                                                
  
 Office: (908) 572-4788                                                         
  
                                                                                
  
 Mail Stop: WHB2S-15                                                            
  
                                                                                
  
 [EMAIL PROTECTED]                                                              
 
                                                                                
  





                                                                           
             Thomas Fischer                                                
             <[EMAIL PROTECTED]                                             
             u.net>                                                     To 
                                       "Apache Torque Users List"          
             03/14/2005 10:44          <torque-user@db.apache.org>         
             AM                                                         cc 
                                                                           
                                                                   Subject 
             Please respond to         RE: doDelete problem, null dbMap    
              "Apache Torque                                               
                Users List"                                                
             <[EMAIL PROTECTED]                                             
                pache.org>                                                 
                                                                           
                                                                           








Jim,

if the db map is not null, but the column is not mapped, then I was
mistaken about the cause of the error, and class.forName() is of no use.

Can you look at the map package (${target.package}.map), locate the Map
class for the Table, and see if it has got an entry for the column OFFRG_N
?

   Thomas


[EMAIL PROTECTED] schrieb am 11.03.2005 20:51:27:

> Thomas,
>
> This is exactly (well.. almost) what I have in my code
>
> //Get a connection
> dbConn = Torque.getConnection(getProperty("db2.environment"));
> dbConn.setAutoCommit(true);
>
> \\db2Schema  is the High level qualifier for the table
> String db2Schema = MixApplication.getProperty("db2schema");
>
> BaseTableNamePeer.executeStatement("SET CURRENT SQLID = '" + db2Schema +
> "'", dbConn);
> BasePeer.executeStatement("SET CURRENT SQLID = '" + db2Schema + "'",
dbConn
> );
>
> Criteria criteria = new Criteria();
> criteria.add(TableNamePeerPeer.OFFRG_N, primaryKey);
> TableNamePeer.doDelete(criteria, dbConn);
>
> By the way, the dbMap was not null, dbMap.getTable(tab) is null.. my
> mistake.
> ColumnMap[] columnMaps = dbMap.getTable(tab).getColumns();
>
> How are you are suggesting I should use the forName()?
>
> Thanks again!
> Jim
>
>
>
>
>
> John,
>
> My first guess would be that the Peer class is not loaded by the
> classloader before you execute the query. See
> http://issues.apache.org/scarab/issues/id/TRQS228
> In Torque 3.1.1, the problem should be resolved. Alternatively, you can
> force the classloader to load the class before you execute the statement,
> e.g. by class.forName();
>
> By the way, what is TableNamePeer.PRIMARY ? Never seen that before; I
> normally would use
> TableNamePeer.doDelete(criteria, dbConn);
>
>   Thomas
>
> [EMAIL PROTECTED] schrieb am 11.03.2005 16:35:13:
>
> > I recently moved over to version 3.1 for Java, I have the selects
working
> > fine now (Thanks). The issue is on a doDelete, the dbMap is null. The
> error
> > is occurring on this line:
> > ColumnMap[] columnMaps = dbMap.getTable(tab).getColumns(); in the
> doDelete.
> >
> > My Criteria is setup as follows:
> > Criteria criteria = new Criteria();
> > criteria.add(TableNamePeer.PRIMARY_KEY, primaryKey);
> > TableNamePeer.PRIMARY.doDelete(criteria, dbConn);
> >
> > This is the main DB2 table and there are many beneath it. Our system
will
> > automatically handle the cascading of the delete. This worked fine in
> 3.0.
> >
> > Thank you in advance!
> > Jim
>
>

>

>  Jim Caserta

>

>  Whitehouse Station CCI - PM&M Systems

>

>  Office: (908) 572-4788

>

>  Mail Stop: WHB2S-15

>

>  [EMAIL PROTECTED]

>

>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to