db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jürgen Hoffmann ...@byteaction.de>
Subject AW: SELECT TABLE.FIELD FROM TABLE. How do I do this?
Date Sat, 12 Apr 2003 11:43:35 GMT
Hi,

this will not work. Because the column Count of the returned Record ist 1
and your Pessoa Objects have more than one field they are filled with. How
should the fields be populated? There is no chance for village/Torque to
find that out.

If you really want Pessoa Objects returned by the query use the normal way,
or produce as many columns as the object has and then you can use a List of
Record Objects to populate the corresponding Objects generated by Torque.
You can use the method

PessoaPeer.populateObjects(recordList);

kind regards

Jürgen Hoffmann

-----Ursprüngliche Nachricht-----
Von: Ricardo Lecheta [mailto:ricardolecheta@brturbo.com]
Gesendet: Samstag, 12. April 2003 07:00
An: Turbine Torque Users List
Betreff: Re: SELECT TABLE.FIELD FROM TABLE. How do I do this?


Thank you Gareth, the code worked, but it shows a list of Record objects. I
would like that the list was of Pessoa objects.
----- Original Message -----
From: "Gareth Boden" <gareth.boden@egsgroup.com>
To: "Turbine Torque Users List" <torque-user@db.apache.org>
Sent: Friday, April 11, 2003 1:16 AM
Subject: Re: SELECT TABLE.FIELD FROM TABLE. How do I do this?

Is there a way to do it?

Ricardo



> SELECT TABLE.FIELD FROM TABLE // only a field of the table
> I tried to do it like this:
>
> Criteria c = new Criteria();
> c.addSelectColumn(PessoaPeer.NOME);
> PessoaPeer.doSelect(c);

> Could you please tell me the right way to do it ?

Use something like:
List l = PessoaPeer.doSelectVillageRecords(c);
for (Iterator it = l.iterator(); it.hasNext(); ) {
Record r = (Record) it.next();
Object valueInColumn1 = r.getValue(1).asObject();
}

Gareth

---
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: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org





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




Mime
View raw message