Class SurveyAnswerDao

All Implemented Interfaces:
LogEnabled, PluginAware, Component, Configurable, Contextualizable, Serviceable

public class SurveyAnswerDao extends AbstractMyBatisDAO
Survey answer DAO.
  • Field Details

    • ROLE

      public static final String ROLE
      The Avalon role name.
  • Constructor Details

  • Method Details

    • 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.
    • getAllSessionCount

      Get the session count list.
      Returns:
      the session count list.
    • getSessions

      Get the exhaustive list of sessions.
      Returns:
      the sessions.
    • getSessions

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

      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<SurveyAnswer> getAnswers(int sessionId)
      Get the answers of a session.
      Parameters:
      sessionId - the session ID.
      Returns:
      the session answers.
    • addSession

      public void addSession(SurveySession session) throws SQLException
      Insert a session with its answers.
      Parameters:
      session - the session.
      Throws:
      SQLException - if a database access error occurs
    • 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.