Search in sources :

Example 6 with FeedbackResponse

use of teammates.storage.entity.FeedbackResponse in project teammates by TEAMMATES.

the class FeedbackResponsesDb method getFeedbackResponseEntitiesFromGiverForQuestionInSection.

private Collection<FeedbackResponse> getFeedbackResponseEntitiesFromGiverForQuestionInSection(String feedbackQuestionId, String giverEmail, String section) {
    Map<String, FeedbackResponse> feedbackResponses = new HashMap<>();
    List<FeedbackResponse> firstQueryResponses = load().filter("feedbackQuestionId =", feedbackQuestionId).filter("giverEmail =", giverEmail).filter("giverSection =", section).list();
    for (FeedbackResponse response : firstQueryResponses) {
        feedbackResponses.put(response.getId(), response);
    }
    List<FeedbackResponse> secondQueryResponses = load().filter("feedbackQuestionId =", feedbackQuestionId).filter("giverEmail =", giverEmail).filter("receiverSection =", section).list();
    for (FeedbackResponse response : secondQueryResponses) {
        feedbackResponses.put(response.getId(), response);
    }
    return feedbackResponses.values();
}
Also used : HashMap(java.util.HashMap) FeedbackResponse(teammates.storage.entity.FeedbackResponse)

Aggregations

FeedbackResponse (teammates.storage.entity.FeedbackResponse)6 HashMap (java.util.HashMap)2 FeedbackResponseAttributes (teammates.common.datatransfer.attributes.FeedbackResponseAttributes)1 EntityAlreadyExistsException (teammates.common.exception.EntityAlreadyExistsException)1 EntityDoesNotExistException (teammates.common.exception.EntityDoesNotExistException)1