Question: Hello, I am creating a website using java language and spring MVC framework + Thymeleaf for view. In my DB I have a table which

Hello,

I am creating a website using java language and spring MVC framework + Thymeleaf for view.

In my DB I have a table which has a self referencing (hierarchal), I have a table for employees which contains an employee Id and for each employee there is a manager Id.. so an employee can be a manager for other employees.

what I want is nested checkboxes (only show managers who are only managers and there is no manager above them) and when check a manager box, other employees checkboxes under this manager will be shown

I create the table in a DB and I have an entity (exactly like the table in DB), but I don't know how to create query (spring JPA only allowed) to retrieve the managers and employees under them

Could any expert help me by give me a code to solve this problem with clear code and explaination

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!