I need to order the Teams resultset such that the team with maximum active & unexpired skills comes first. I am using spring boot Specification & CriteriaQuery to filter Teams on different fields. So far I have the code below which doesn't work as expected.
Hi Himai, the code will only perform the join between Team and Employee, which I have already done in my code. I am unable to pull the total number of the skills of each team.
How about building a query like select count(distinct skills) from team_employee where team_employee is the joint table?
I am not familiar with Specification though.
Himai Minh wrote:How about building a query like select count(distinct skills) from team_employee where team_employee is the joint table?
I am not familiar with Specification though.
I am stuck with Specification here since this is on an old code where I don't really have an option to change a lot of things.
In your toPredicate method, is it possible to use the criteria builder to build
a query like this one "select count( distinct skills) from Team_Employee " where Team_Employee is the joint table ?
Don't get me started about those stupid light bulbs.