Hi all,
I have created a generic search component using criteria API. It works great except a few issues and one of them is proving to be a blocker for the project.
I have a class association similar to this
public class Project {
private Long id;
...
...
private Set teamMembers; // set of TeamMember type
}
public class TeamMember {
private Long id;
....
....
private String memberRole; //can be 'Manager', 'Leader', 'Developer', etc
}
Now I have show list of Projects with attibutes like name, dateStarted, Leaders, etc.
I get the list of project objects and render each object as a row. For displaying the leaders, i iterate over the teamMember collection and show name only if role == 'Leader'.
All this is workig fine but the problem is that the result set should be sortable on all displayed columns and I am not able to think of a way to provide sorting on Leaders, i.e. sort the project objects on the basis of Leader names.
Please note that the teamMember set in Project object can have :
1. no members at all.
2. 1 or more members but no leader
3. 1 or more members with one or more leaders.
Any help to resolve the issue will be highly appreciated.
rohit
|