db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <Fisc...@seitenbau.net>
Subject RE: Criteria parses to "SELECT FROM .."
Date Wed, 14 Jul 2004 09:00:00 GMT

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)

This explains why you dont see any select columns if you print the query
before you call the doSelectMethod.
So adding
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,


To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org

View raw message