Hibernate with Connect BY

 Here is HQL query for CONNECT BY, to extract based on the PRIOR parent id 

<sql-query name=”findDepartmentByPriorId”>

<return class=”EmployeeDepartment” />
 SELECT ed.* FROM EmployeeDepartment ed CONNECT BY ed.PARENTDEPARTMENTID = PRIOR ed.DEPARTMENTID START WITH ed.DEPARTMENTID=?

</sql-query>

 Here is HQL query for CONNECT BY, to extract based on the PRIOR parent id  <sql-query name=”findDepartmentByPriorId”> <return class=”EmployeeDepartment” />  SELECT ed.* FROM EmployeeDepartment ed CONNECT BY ed.PARENTDEPARTMENTID = PRIOR ed.DEPARTMENTID START WITH ed.DEPARTMENTID=? </sql-query>

Leave a Reply

Your email address will not be published. Required fields are marked *

Hibernate with Connect BY

 Here is HQL query for CONNECT BY, to extract based on the PRIOR parent id 

<sql-query name=”findDepartmentByPriorId”>

<return class=”EmployeeDepartment” />
 SELECT ed.* FROM EmployeeDepartment ed CONNECT BY ed.PARENTDEPARTMENTID = PRIOR ed.DEPARTMENTID START WITH ed.DEPARTMENTID=?

</sql-query>

 Here is HQL query for CONNECT BY, to extract based on the PRIOR parent id  <sql-query name=”findDepartmentByPriorId”> <return class=”EmployeeDepartment” />  SELECT ed.* FROM EmployeeDepartment ed CONNECT BY ed.PARENTDEPARTMENTID = PRIOR ed.DEPARTMENTID START WITH ed.DEPARTMENTID=? </sql-query>

Leave a Reply

Your email address will not be published. Required fields are marked *