I see.  You want select distinct on the street column!  Well, you could just
do

List street = LocationPeer.doQuery("select distinct street from location")..


Now, i can't quite remember the method, but attached to BasePeer is a method
to just execute sql statements.  This returns a list of Record objects.  To
use them, look at the Village code (that is a layer below Torque!).  Then
just do something like build a list by iterationg over your list of records
and doing 
        streets.add(Record.get(0) );


I don't have the syntax down quite right, but it isn't hard...  Just look at
BasePeer and Village.

Eric

-----Original Message-----
From: Schell, Scott A (Scott) [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 16, 2002 1:36 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: Help with Torque and Validations


Actually, I have no street table (and don't want
one)...I actually want to figure out how to get
a list of streets out of the location table...

(If I had a street table, you are correct, it's
easy to do...do you have a solution when there 
is not a street table)?

Scott

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 16, 2002 8:08 AM
To: [EMAIL PROTECTED]
Subject: RE: Help with Torque and Validations


You just need to do a select distinct on your Street table?

Criteria c = new Criteria()
c.setDistinct(true);
List streets = StreetPeer.doSelect(c);

Enjoy,
Eric Pugh

-----Original Message-----
From: Schell, Scott A (Scott) [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 16, 2002 10:10 AM
To: [EMAIL PROTECTED]
Subject: Help with Torque and Validations


Hi All,
 
    This may be a rookie question, just coming on board...
Say I have a table of locations:
 
- ID
- Address
- Street
- ...
    
    And I want to provide a combo-box for the user of the distinct
streets in the table (e.g. select distinct street...).  I don't want to
have to create a validation table (e.g. Streets) to do that...Do I
go into the peer classes and do some work (if so, could someone
point me at a similar example).  Getting back a vector of distinct
streets is perfect...Thoughts/Help?
 
Thanks
 
Scott Schell
[EMAIL PROTECTED]
 

Reply via email to