Hi,
I would to display Company details (Company) as a treetable to Auditor (User) who belongs to that Department.
For Example:
An auditor who belongs to Logistics Department should be able to view only the rows (Company) belonging to Logistics Department.
I have 4 Entities. Company, Auditors, Department and User.
Company - has many attributes but department is the common attribute
Auditor - User user (Admin creates Users and assigns them as Auditors. There is relationship between Auditor and User)
- department is the common attribute
Department - name (attribute)
Entity Company and Auditor are unrelated. But both of them have a common attribute (department).
I want a JPQL query like below:
Select c from Company join a from Auditor ON a.department = c.department left join a.user us ON us.id = session$userId
I want to display company details as rows to a currently logged user who is an auditor who belongs to same department.
Your help will be appreciated.
Thanks