Merge branch 'project' into develop
This commit is contained in:
commit
9b93315baf
src/main/java/se/su/dsv/scipro
@ -1,5 +1,6 @@
|
||||
package se.su.dsv.scipro.data.dataobjects;
|
||||
|
||||
import com.mysema.query.annotations.QueryInit;
|
||||
import org.apache.wicket.markup.html.panel.Panel;
|
||||
import org.hibernate.annotations.Cache;
|
||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
@ -51,8 +52,9 @@ public class Project extends DomainObject implements Comparable<Project>, Iconiz
|
||||
@Sort(type=SortType.NATURAL) //Required by hibernate
|
||||
private SortedSet<ProjectFollower> projectFollowers = new TreeSet<ProjectFollower>();
|
||||
|
||||
@ManyToOne
|
||||
@ManyToOne
|
||||
@SortableField
|
||||
@QueryInit({"user"})
|
||||
private Employee headSupervisor;
|
||||
|
||||
@OneToOne(mappedBy="project", orphanRemoval = true)
|
||||
|
@ -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
|
||||
@ -125,9 +126,18 @@ public class ProjectServiceImpl extends AbstractQueryService<Project, Long> impl
|
||||
}
|
||||
|
||||
private BooleanExpression titleContains(String searchTerm) {
|
||||
return QProject.project.title.contains(searchTerm);
|
||||
return QProject.project.title.containsIgnoreCase(searchTerm);
|
||||
}
|
||||
|
||||
private BooleanExpression headSupervisorFirstNameContains(String searchTerm){
|
||||
return QProject.project.headSupervisor.user.firstName.containsIgnoreCase(searchTerm);
|
||||
}
|
||||
|
||||
private BooleanExpression headSupervisorLastNameContains(String searchTerm){
|
||||
return QProject.project.headSupervisor.user.lastName.containsIgnoreCase(searchTerm);
|
||||
}
|
||||
|
||||
|
||||
private BooleanExpression hasProjectClass(ProjectClass pc) {
|
||||
if (pc != null)
|
||||
return QProject.project.projectClass.eq(pc);
|
||||
|
Loading…
x
Reference in New Issue
Block a user