You probably want to add a method to your LocationPeer something like:

public Vector getDistinctStreets() {
        Criteria criteria = new Criteria();
        criteria.addSelectColumn(STREET);
        criteria.setDistinct(true);
        List l = doSelectVillageRecords(criteria);
        if (l != null) {
                Vector result = new Vector(l.size());
                for (Iterator it = l.iterator(); it.hasNext(); ) {
                        Record r = (Record) it.next();
                        String street = r.getValue(1).asString();
                        result.add(street);
                }
                return result;
        } else {
                return null;
        }
}

On Wednesday, October 16, 2002, at 03:10  pm, Schell, Scott A (Scott) 
wrote:

> 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]
>
>
---
Development Team Leader, eGS, 5-7 Singer Street, London EC2A 4BQ. +44 
(0)20 7336 1440

CONFIDENTIALITY: This is email is confidential and intended solely for 
the use of the individual to whom it is addressed.� Any views or 
opinions presented are solely those of the author and do not necessarily 
represent those of eGovernment Solutions (UK) Ltd.� If you are not the 
intended recipient, be advised that you have received this email in 
error and that any use, dissemination, forwarding, or copying of this 
email is strictly prohibited.� If you have received this email in error 
please contact the sender.


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

Reply via email to