trying to make querying by head supervisor name work
This commit is contained in:
parent
ba26a17844
commit
68e3a44614
@ -53,7 +53,8 @@ public class ProjectServiceImpl extends AbstractQueryService<Project, Long> impl
|
||||
|
||||
@Override
|
||||
public Page<Project> find(String filterString, Pageable pageable) {
|
||||
return projectRepo.findAll(titleContains(filterString), pageable);
|
||||
// return projectRepo.findAll(titleContains(filterString), pageable);
|
||||
return projectRepo.findAll(titleContains(filterString).or(headSupervisorFirstNameContains(filterString).or(headSupervisorLastNameContains(filterString))), pageable);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -128,6 +129,17 @@ public class ProjectServiceImpl extends AbstractQueryService<Project, Long> impl
|
||||
return QProject.project.title.contains(searchTerm);
|
||||
}
|
||||
|
||||
private BooleanExpression headSupervisorFirstNameContains(String searchTerm){
|
||||
if (QProject.project.headSupervisor.isNotNull()){
|
||||
|
||||
}
|
||||
return QProject.project.headSupervisor.user.firstName.contains(searchTerm);
|
||||
}
|
||||
private BooleanExpression headSupervisorLastNameContains(String searchTerm){
|
||||
return QProject.project.headSupervisor.user.lastName.contains(searchTerm);
|
||||
}
|
||||
|
||||
|
||||
private BooleanExpression hasProjectClass(ProjectClass pc) {
|
||||
if (pc != null)
|
||||
return QProject.project.projectClass.eq(pc);
|
||||
|
Loading…
x
Reference in New Issue
Block a user