> From: "Colin Chalmers" <[EMAIL PROTECTED]>
> 
> Hi,
> 
> My usual use of Criteria means that although I get all required records
> back, I don't necessarily want all the data in the object i.e. for an index
> page I only require three from the 10 fields/columns.
> 
> Is it possible to limit this data when performing the query whereby the
> objects only contain the fields I specify?

Yes.  Use:

    criteria.addSelectColumn(MyTablePeer.MY_COLUMN_NAME);

... for as many columns as you want to add.  You can add select columns for
any tables you join in your criteria.  The cost of doing this is that you
must write your own code for extracting the information out of the resulting
Vector or List which will contain com.workingdogs.village.Record objects.
This is reasonably straightforward - iterate over the Vector/List and for
each Record use getValue(n).asType() where "n" is an index into the included
columns (starting from 1) and "asType()" is one of the available type
converters (e.g. asString(), asDate(), etc.)

> 
> Thx
> 
> /Colin

Cheers,

Scott
-- 
Scott Eade
Backstage Technologies Pty. Ltd.
Web: http://www.backstagetech.com.au



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to