c.addAlias("A", "<object_owner>" + PlacHistTPeer.TABLE_NAME);

-----Original Message-----
From: Caron, Roger A. [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 18, 2004 3:09 PM
To: '[EMAIL PROTECTED]'
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to