diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamDAOImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamDAOImpl.java index 287e0d25..cbd17475 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamDAOImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamDAOImpl.java @@ -228,6 +228,7 @@ public class ExamDAOImpl implements ExamDAO { this.examRecordMapper.updateByExampleSelective(examRecord) .where(ExamRecordDynamicSqlSupport.id, isIn(ids)) + .and(ExamRecordDynamicSqlSupport.status, isNotEqualTo(ExamStatus.ARCHIVED.name())) .build() .execute(); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamRecordDAO.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamRecordDAO.java index f36aadcd..c6a65cf9 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamRecordDAO.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamRecordDAO.java @@ -193,6 +193,11 @@ public class ExamRecordDAO { .and( ExamRecordDynamicSqlSupport.status, isInWhenPresent(stateNames)); + } else { + whereClause = whereClause + .and( + ExamRecordDynamicSqlSupport.status, + isNotEqualTo(ExamStatus.ARCHIVED.name())); } final List records = whereClause