From: "Jason van Zyl" <[EMAIL PROTECTED]>
> What are you doing??? Look at the example app in the TDK, I was wondering
> why you asked for Village documentation in the TDK. The peers to exactly
> what you are describing:
I totally didn't read Andrea's first reply to her own post correctly.
For a straight join where you want all columns from both of the
tables then the standard methods discussed in the other replies
are fine.
Where I find I need the code that includes use of village.Record in a
manner similar to Andrea's second post is when I have something like
criteria.addSelectColumn(TableAPeer.A_COLUMN_3);
criteria.addSelectColumn(TableBPeer.B_COLUMN_7);
or I am skipping the use of Criteria all together thus:
String query = "SELECT COUNT(*) FROM ORDER_ITEM WHERE ORDER_ID = " + orderId + ";";
Vector qresult = BasePeer.executeQuery(query);
Record rec = (Record) qresult.firstElement();
int recordCount = rec.getValue(1).asInt();
These obviously better examples of when I believe I need to use
village.Record directly. I would love a better way of handling this
if it currently exists.
Would it be possible to extend torque to provide:
1. Additional criteria to support COUNT(), SUM(), CURRENT_DATE, etc.
2. The ability to map to an object that you know maps to the structure
of the query result (perhaps requiring the use of AS for the selected
columns that don't have a natural name).
Cheers,
Scott
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]