db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a7b46...@telus.net
Subject question on Torque's limitation
Date Mon, 30 Jun 2003 23:07:53 GMT
Suppose I have an Oracle table called A and a table called A_TR (TR stands for 
translation) for multi-language support. These two tables contain following 
columns respectively:
A.ID (pk), A.NAME
A_TR.ID(pk, fk to A.ID), A_TR.LOCALE (pk), A_TR.NAME

If I want to get A_TR.NAME if it is available, othwise use A.NAME. Using SQL, I 
can get it pretty easily:
select nvl(A_TR.name,A.name) as name from A, A_TR 
where A.id=A_TR.id(+) and lower(A_TR.locale(+)) = lower('en-us')

But it seems in Torque this will be awefully complex if not impossible (unless 
I resort back to brute force SQL). The complication arises from:
1. Creteria doesn't support outer-join
2. The peer class doesn't support ad hoc SELECT clause. I can only get the 
columns within a table. Combining columns in two tables with Oracle function 
such as NVL is almost impossible.

Since I am new to Torque, I would like confirmation if these indeed are 
limitation of Torque. Is there any get-around that doesn't need multiple db hit 
(don't take query cache into account)?

Thanks




Mime
View raw message