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 19:26:32 GMT
On Wed, Apr 18, 2007 at 02:23:12PM -0400, Greg Monroe wrote:
> Sounds like you want to use the:
> 
>   Criteria.addAscendingOrderBy(Column)
>   Criteria.addDecendingOrderBy(Column)
 
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?

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