Interface QuestionService

  • All Known Implementing Classes:
    DefaultQuestionService

    public interface QuestionService
    Interface declaration
    Author:
    • Method Detail

      • getQuestion

        Question getQuestion​(QuestionPK questionPK)
        Get a question
        Parameters:
        questionPK - the question id
        Returns:
        a Question
      • getQuestionsByFatherPK

        Collection<Question> getQuestionsByFatherPK​(QuestionPK questionPK,
                                                    String fatherId)
        Get all questions for a given father
        Parameters:
        questionPK - the question id
        fatherId - the father id
        Returns:
        a Collection of Question
      • createQuestion

        QuestionPK createQuestion​(Question question)
        Create a new question
        Parameters:
        question - the question to create
        Returns:
        the id of the new question
      • createQuestions

        void createQuestions​(Collection<Question> questions,
                             String fatherId)
        Create some questions to a given father
        Parameters:
        questions - a Collection of Question to create
        fatherId - the father id
      • deleteQuestionsByFatherPK

        void deleteQuestionsByFatherPK​(QuestionPK questionPK,
                                       String fatherId)
        Delete the questions of a father
        Parameters:
        questionPK - the question context
        fatherId - the father id
      • deleteQuestion

        void deleteQuestion​(QuestionPK questionPK)
        Delete a question
        Parameters:
        questionPK - the question id to delete
      • updateQuestion

        void updateQuestion​(Question questionDetail)
        Update a question
        Parameters:
        questionDetail - the question to update
      • updateQuestionHeader

        void updateQuestionHeader​(Question questionDetail)
        Update a question header (self attributes)
        Parameters:
        questionDetail - the question attributes
      • updateAnswersToAQuestion

        void updateAnswersToAQuestion​(Question questionDetail)
        Update the answers to a question
        Parameters:
        questionDetail - the question containing the answers
      • updateAnswerToAQuestion

        void updateAnswerToAQuestion​(Answer answerDetail)
        Update an answer to a question
        Parameters:
        answerDetail - the answer to update
      • deleteAnswersToAQuestion

        void deleteAnswersToAQuestion​(QuestionPK questionPK)
        Delete all answers to a question
        Parameters:
        questionPK - the question
      • deleteAnswerToAQuestion

        void deleteAnswerToAQuestion​(AnswerPK answerPK,
                                     QuestionPK questionPK)
        Delete an answer to a question
        Parameters:
        answerPK - the answer id to delete
        questionPK - the question id
      • createAnswersToAQuestion

        void createAnswersToAQuestion​(Question questionDetail)
        Create some answers to a question
        Parameters:
        questionDetail - the question which contains the answers
      • createAnswerToAQuestion

        AnswerPK createAnswerToAQuestion​(Answer answerDetail,
                                         QuestionPK questionPK)
        Add an answer to a question
        Parameters:
        answerDetail - the new answer
        questionPK - the question id
        Returns:
        the PK of the new answer