コード例 #1
0
 public void delete(ProblemEntity problem) {
   for (String string : problem.getAnswers()) {
     AnswerEntity answerEntity = answerService.getAnswerByKey(string);
     answerService.delete(answerEntity);
   }
   persistenceManager.deletePersistent(problem);
 }
コード例 #2
0
 public boolean inDataBase(ProblemEntity problemEntity) {
   List<TestEntity> testEntities = testService.getTestes();
   for (TestEntity testEntity : testEntities) {
     List<String> problemEntities = testEntity.getProblems();
     for (String problemKey : problemEntities) {
       if (problemEntity.getKey().equals(problemKey)) {
         return true;
       }
     }
   }
   return false;
 }