db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mark.a.g...@accenture.com
Subject RE: Criteria: Multiple Instances of same table
Date Tue, 18 May 2004 19:32:46 GMT
c.addAlias("A", "<object_owner>" + PlacHistTPeer.TABLE_NAME);

-----Original Message-----
From: Caron, Roger A. [mailto:roger.caron@pw.utc.com] 
Sent: Tuesday, May 18, 2004 3:09 PM
To: 'torque-user@db.apache.org'
Subject: Criteria: Multiple Instances of same table


I'm trying to run a query which compares IDs in two tables against the
IDs of a third, based on criteria set on the third.  The problem is that
the two tables I want to return have to use different data sets from the
third since they're not identical.

Here's my actual situation:
Table 1: PERMISSIONS
Table 2: OBJECT1
Table 3: OBJECT2

My permissions works similar to a tree, where if you have access to
OBJECT1, you may have access to OBJECT2, but just because you have
permission to OBJECT2 doesn't guarantee you access since you may not be
able to access OBJECT1.

So what I'm looking for is something to get the following sql:

select OBJECT2.objectName from OBJECT2, OBJECT1, PERMISSIONS A,
PERMISSIONS B where OBJECT2.permissionId=A.permissionId and
OBJECT1.permissionId=B.permissionId and A.usersWithAccess="roger" and
B.usersWithAccess="roger"

This way I can test if "roger" has access to OBJECT2 and OBJECT1 and
therefore display OBJECT2.

Any suggestions on how to get multiple instances of the PERMISSIONS
table?

Thanks

Roger 


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



This message is for the designated recipient only and may contain privileged, proprietary,
or otherwise private information.  If you have received it in error, please notify the sender
immediately and delete the original.  Any other use of the email by you is prohibited.

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