searching projects on head supervisor works now
This commit is contained in:
parent
68e3a44614
commit
ff755e7acd
src/main/java/se/su/dsv/scipro
@ -1,5 +1,6 @@
|
|||||||
package se.su.dsv.scipro.data.dataobjects;
|
package se.su.dsv.scipro.data.dataobjects;
|
||||||
|
|
||||||
|
import com.mysema.query.annotations.QueryInit;
|
||||||
import org.apache.wicket.markup.html.panel.Panel;
|
import org.apache.wicket.markup.html.panel.Panel;
|
||||||
import org.hibernate.annotations.Cache;
|
import org.hibernate.annotations.Cache;
|
||||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
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
|
@Sort(type=SortType.NATURAL) //Required by hibernate
|
||||||
private SortedSet<ProjectFollower> projectFollowers = new TreeSet<ProjectFollower>();
|
private SortedSet<ProjectFollower> projectFollowers = new TreeSet<ProjectFollower>();
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
@SortableField
|
@SortableField
|
||||||
|
@QueryInit({"user"})
|
||||||
private Employee headSupervisor;
|
private Employee headSupervisor;
|
||||||
|
|
||||||
@OneToOne(mappedBy="project", orphanRemoval = true)
|
@OneToOne(mappedBy="project", orphanRemoval = true)
|
||||||
|
@ -126,17 +126,18 @@ public class ProjectServiceImpl extends AbstractQueryService<Project, Long> impl
|
|||||||
}
|
}
|
||||||
|
|
||||||
private BooleanExpression titleContains(String searchTerm) {
|
private BooleanExpression titleContains(String searchTerm) {
|
||||||
return QProject.project.title.contains(searchTerm);
|
return QProject.project.title.containsIgnoreCase(searchTerm);
|
||||||
}
|
}
|
||||||
|
|
||||||
private BooleanExpression headSupervisorFirstNameContains(String searchTerm){
|
private BooleanExpression headSupervisorFirstNameContains(String searchTerm){
|
||||||
if (QProject.project.headSupervisor.isNotNull()){
|
// if (QProject.project.headSupervisor.isNotNull()){
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
return QProject.project.headSupervisor.user.firstName.contains(searchTerm);
|
return QProject.project.headSupervisor.user.firstName.containsIgnoreCase(searchTerm);
|
||||||
}
|
}
|
||||||
|
|
||||||
private BooleanExpression headSupervisorLastNameContains(String searchTerm){
|
private BooleanExpression headSupervisorLastNameContains(String searchTerm){
|
||||||
return QProject.project.headSupervisor.user.lastName.contains(searchTerm);
|
return QProject.project.headSupervisor.user.lastName.containsIgnoreCase(searchTerm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user