db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brendan Miller" <bmil...@dotster.com>
Subject Re: Wrong SQL generation from Criteria
Date Wed, 18 Apr 2007 22:55:33 GMT
> Right you are.  I guess I got the group by mentality because I don't
> really care what order they're in--just so long as records with the same
> values for certain columns are together.
> 
> But this still leaves me a "column ambiguously defined" error when using
> addJoin():
> 
>     crit.addJoin(TableAPeer.ColumnX, TableBPeer.ColumnG);
>     crit.addAscendingOrderByColumn(TableBPeer.ColumnQ);
>     crit.addAscendingOrderByColumn(TableBPeer.ColumnR);
>     List<TableB> tableBs = TableBPeer.doSelect(crit);
> 
> generates
> 
>     SELECT <..TableB fields> FROM TABLE_A, TABLE_B, DBSCHEMA.TABLE_B WHERE TABLE_A.COLUMN_X=TABLE_B.COLUMN_G
ORDER BY TABLE_B.COLUMN_Q ASC, TABLE_B.COLUMN_R ASC
> 
> Where does the extra DBSCHEMA.TABLENAME come from?  Did I miss that in your 
> original response?
> 

It appears this is glued on by the presence of 

    torque.dsfactory.programs.schema = DBSCHEMA

in the Torque.properties file.  The docs say that this is only used
 a) by Oracle
 b) for the JDBC->XML and SQL Ant tasks

It seems (b) is false--it alters the way doSelect() works (by prepending 
its value to the table name.  Is this a bug?

Brendan



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


Mime
View raw message