[Date Prev][Date Next] [Chronological] [Thread] [Top]

Complex Query



Hi,
	I want to perform one complex query but have limited knoledge in
this arena. I've employees defined under 'Employee' entry in my LDAP tree
and roles defined under 'Roles' entry. Each employee can have multiple
roles. I'm showing employees belonging to each role as 'member' in my role
entry. I want to retrieve all employees for a particular role. I can first
search for all member entries for the role and then can get those employee
details from Employee node. But this involves multiple queries on LDAP. Is
it possible to get all employees(with details) having a perticular role in
one query ?? I dont want to change the tree structure as there are some
other dependencies. 

	Following is part of my LDIP file showing employee and role entries.


Thanks,
Mahesh

----------------------------------------------------------------------------
-----------------

All Employees defined under 'Employees' Entry:

dn: ou=Employees,o=Agilisys1
ou: Employees
objectclass: organizationalUnit

dn: uid=EMP001,ou=Employees,o=Agilisys1
ou: Employees
uid: EMP001
cn: Mahesh
sn: Patil
userPassword: password
objectclass: inetOrgPerson
objectclass: organizationalUnit

dn: uid=EMP002,ou=Employees,o=Agilisys1
ou: Employees
uid: EMP002
cn: Anish
sn: Shah
userPassword: password
objectclass: inetOrgPerson
objectclass: organizationalUnit

dn: uid=EMP003,ou=Employees,o=Agilisys1
ou: Employees
uid: EMP003
cn: Roy
sn: Dsouza
userPassword: password
objectclass: inetOrgPerson
objectclass: organizationalUnit

All Roles defined under 'Site' entry

dn: cn=CallCenterUser,ou=MSV,ou=Sites,ou=ABS,ou=Application,o=Agilisys1
ou: MSV
cn: CallCenterUser
description: MSV
roleOccupant: cn=CallCenterUser,ou=Roles,ou=ABS,ou=Application,o=Agilisys1
member: uid=EMP001,ou=Employees,o=Agilisys1
objectclass: organizationalRole
objectclass: groupOfNames

dn: cn=LettingsOfficer,ou=MSV,ou=Sites,ou=ABS,ou=Application,o=Agilisys1
ou: MSV
cn: LettingsOfficer
description: MSV
roleOccupant: cn=LettingsOfficer,ou=Roles,ou=ABS,ou=Application,o=Agilisys1
member: uid=EMP002,ou=Employees,o=Agilisys1
objectclass: organizationalRole
objectclass: groupOfNames

dn: cn=FinanceOfficer,ou=MSV,ou=Sites,ou=ABS,ou=Application,o=Agilisys1
ou: MSV
cn: FinanceOfficer
description: MSV
roleOccupant: cn=FinanceOfficer,ou=Roles,ou=ABS,ou=Application,o=Agilisys1
member: uid=EMP003,ou=Employees,o=Agilisys1
member: uid=EMP002,ou=Employees,o=Agilisys1
objectclass: organizationalRole
objectclass: groupOfNames