You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Sheng Guo <sh...@in.tum.de> on 2004/03/17 21:02:32 UTC

sql translation

Hello,

I am a new user of torque, and I would like to translate the following 
sql statement into torque,

select c.name, u.firstname, u.lastname
from   sys_contact c,  sys_contact_user u
where  u.sys_contact_id =  c.id

Could you please help me?

yours sincerely

Guo


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


RE: sql translation

Posted by Luca Zappa <lu...@lucazappa.com>.
Hi Guo,
  can you send us the xml schema of your db?

If you define correctly foreing keys, that query is just implemented.
Otherwise you can use Critera:

Criteria c = new Criteria();
c.addJoin(Table1Peer.PUBLISHER_ID,Table2Peer.PUBLISHER_ID);
List rows = BasePeer.doSelect(c);

Regards,
  Luca

-----Original Message-----
From: Sheng Guo [mailto:sheng@in.tum.de] 
Sent: Wednesday, March 17, 2004 9:03 PM
To: torque-user@db.apache.org
Subject: sql translation

Hello,

I am a new user of torque, and I would like to translate the following sql
statement into torque,

select c.name, u.firstname, u.lastname
from   sys_contact c,  sys_contact_user u
where  u.sys_contact_id =  c.id

Could you please help me?

yours sincerely

Guo


---------------------------------------------------------------------
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