Thanx... I will try it.

Göschl,Siegfried wrote:

Hi Thomas,

A good approach is to use P6Spy to trace ALL SQL statements generated by Torque

Cheers,

Siegfried Goeschl

-----Original Message-----
From: Thomas Fischer [mailto:[EMAIL PROTECTED] Sent: Mittwoch, 14. Juli 2004 11:00
To: Apache Torque Users List
Subject: RE: Criteria parses to "SELECT FROM .."








Hi Ron,

I guess the point is that in every Peer class for a database table, in the method 
doSelectVillageRecords(Criteria criteria, Connection con) which is called from the 
usual doSelect(criteria), the following call is made BEFORE the criteria is converted 
to a query:

       if (criteria.getSelectColumns().size() == 0)
       {
           addSelectColumns(criteria);
       }

This explains why you dont see any select columns if you print the query before you 
call the doSelectMethod. So adding System.out.println(createQueryString(c));
AFTER calling doSelect should print the correct Columns...

There are more pitfalls like this if you use createQueryString() yourself, so if you 
want to know which Query is actually executed is the Torque Debug log !!!



c.add(CATEGORIES_ID, id);
c.add(LANGUAGE_ID, language.getLanguagesId());
try {
System.out.println(createQueryString(c));
return doSelect(c);
}
catch (TorqueException ex) {
ex.printStackTrace();
return EMPTY;
}



I do not see any error in this code. What exactly happens if you execite the code ?

   Hope that helps,

         Thomas



---------------------------------------------------------------------
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