db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Manaster, Carl" <Ca...@ACTIVX.com>
Subject RE: ORDER BY and torque generated column names
Date Mon, 06 Oct 2008 17:11:58 GMT
Hi, Graham,

> Am I doing something wrong in the following code?
> criteria.addJoin(BPeer.POLICYDETAIL_ID, 
> criteria.addDescendingOrderByColumn(BPeer.UNDERWRITING_YEAR);
> criteria.addDescendingOrderByColumn(APeer.POLICYDETAIL_ID);
> APeer.doSelect(criteria);

I think the issue is that when you ask APeer to select, it will select
only the fields from a; it's telling you that you can't ORDER BY
b.underwriting_year because that is not one of the columns in a.  You
could specify with addSelectColumn() exactly which columns you want to
select and use BasePeer.doSelect() instead of APeer.doSelect, but that
will give you com.workingdogs.village Records rather than a's, if that


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

View raw message