Class SurveyAnswerDao

    • Field Detail

      • ROLE

        public static final String ROLE
        The Avalon role name.
    • Method Detail

      • getSession

        public SurveySession getSession​(int sessionId)
        Get a session from its ID.
        Parameters:
        sessionId - the session ID.
        Returns:
        the session.
      • getSession

        public SurveySession getSession​(String surveyId,
                                        UserIdentity user)
        Get a user session from the survey ID and the user identity.
        Parameters:
        surveyId - the survey ID.
        user - the user.
        Returns:
        the session.
      • getSessionWithAnswers

        public SurveySession getSessionWithAnswers​(int sessionId)
        Get a session from its ID.
        Parameters:
        sessionId - the session ID.
        Returns:
        the session.
      • getSessionCount

        public int getSessionCount​(String surveyId)
        Get the count of sessions for a given survey.
        Parameters:
        surveyId - the survey ID.
        Returns:
        the session count for this survey.
      • getSessions

        public List<SurveySessiongetSessions​(String surveyId)
        Get all the sessions of a given survey.
        Parameters:
        surveyId - the survey ID.
        Returns:
        the sessions.
      • getSessionsWithAnswers

        public List<SurveySessiongetSessionsWithAnswers​(String surveyId)
        Get all the sessions of a given survey, with their answers.
        Parameters:
        surveyId - the survey ID.
        Returns:
        the sessions with their answers.
      • getAnswers

        public List<SurveyAnswergetAnswers​(int sessionId)
        Get the answers of a session.
        Parameters:
        sessionId - the session ID.
        Returns:
        the session answers.
      • deleteSession

        public void deleteSession​(String sessionId)
        Delete a session with its answers.
        Parameters:
        sessionId - the session ID.
      • deleteSessions

        public void deleteSessions​(String surveyId)
        Delete sessions related to a given survey.
        Parameters:
        surveyId - the survey ID.
      • getStatementSuffix

        protected String getStatementSuffix​(Connection connection)
        Get the statement name suffix, depending of the DBMS family.
        Parameters:
        connection - the connection.
        Returns:
        the statement suffix.