ManagerId is nothing but EmpId. i need all the EmpId that come under the given EmpId including all the subtree. without using CTE as i'm trying this with HQL. with no hierarchy level defined.
+-------+-----------+
| EmpId | ManagerId |
+-------+-----------+
| 1 | null |
| 2 | 1 |
| 3 | 2 |
| 4 | 3 |
| 5 | 1 |
| 6 | 3 |
| 7 | 6 |
| 8 | 6 |
| 9 | null |
| 10 | 3 |
| 11 | 10 |
| 12 | 1 |
| 13 | 12 |
+-------+-----------+
when the givem EmpId is 3: expected response:
4
6
10
7
8
11