Added reviewer as a filterable Param to ProjectIdeaDao and its implementation class.

This commit is contained in:
anto-gom 2012-03-02 09:13:29 +01:00
parent fde55d3944
commit e1b136ea42
2 changed files with 20 additions and 0 deletions
src/main/java/se/su/dsv/scipro/match/dao

@ -43,6 +43,8 @@ public interface ProjectIdeaDao extends Dao<ProjectIdea> {
private Employee supervisor;
private Employee reviewer;
private Student author;
private Boolean projectCreated;
@ -96,6 +98,14 @@ public interface ProjectIdeaDao extends Dao<ProjectIdea> {
return supervisor;
}
public void setReviewer(Employee reviewer) {
this.reviewer = reviewer;
}
public Employee getReviewer() {
return reviewer;
}
public void setAuthor(Student author) {
this.author = author;
}

@ -119,6 +119,7 @@ public class ProjectIdeaDaoJPAImp extends AbstractDaoJPAImp<ProjectIdea>
.projectCreated(params.isProjectCreated())
.author(params.getAuthor())
.supervisor(params.getSupervisor())
.reviewer(params.getReviewer())
.sortAndPaginate(params);
}
@ -154,6 +155,15 @@ public class ProjectIdeaDaoJPAImp extends AbstractDaoJPAImp<ProjectIdea>
}
return this;
}
public QuerySet reviewer(Employee reviewer) {
if (reviewer != null) {
getQuery().combine(
new Query().where("_.reviewer = :reviewer")
.parameter("reviewer", reviewer));
}
return this;
}
public QuerySet matchDateAfter(Date matchDateAfter) {
if (matchDateAfter != null) {