Package org.ametys.plugins.survey.data
Class SurveyAnswerDao
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.core.datasource.AbstractMyBatisDAO
org.ametys.plugins.survey.data.SurveyAnswerDao
- All Implemented Interfaces:
LogEnabled
,PluginAware
,Component
,Configurable
,Contextualizable
,Serviceable
Survey answer DAO.
-
Field Summary
Fields inherited from class org.ametys.core.datasource.AbstractMyBatisDAO
_manager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addSession
(SurveySession session) Insert a session with its answers.void
deleteSession
(String sessionId) Delete a session with its answers.void
deleteSessions
(String surveyId) Delete sessions related to a given survey.Get the session count list.getAnswers
(int sessionId) Get the answers of a session.getSession
(int sessionId) Get a session from its ID.getSession
(String surveyId, UserIdentity user) Get a user session from the survey ID and the user identity.int
getSessionCount
(String surveyId) Get the count of sessions for a given survey.Get the exhaustive list of sessions.getSessions
(String surveyId) Get all the sessions of a given survey.getSessionsWithAnswers
(String surveyId) Get all the sessions of a given survey, with their answers.getSessionWithAnswers
(int sessionId) Get a session from its ID.protected String
getStatementSuffix
(Connection connection) Get the statement name suffix, depending of the DBMS family.Methods inherited from class org.ametys.core.datasource.AbstractMyBatisDAO
_configureDatasource, _getDataSourceId, _getMyBatisConfiguration, configure, contextualize, getSession, getSession, reload, service, setPluginInfo
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The Avalon role name.
-
-
Constructor Details
-
SurveyAnswerDao
public SurveyAnswerDao()
-
-
Method Details
-
getSession
Get a session from its ID.- Parameters:
sessionId
- the session ID.- Returns:
- the session.
-
getSession
Get a user session from the survey ID and the user identity.- Parameters:
surveyId
- the survey ID.user
- the user.- Returns:
- the session.
-
getSessionWithAnswers
Get a session from its ID.- Parameters:
sessionId
- the session ID.- Returns:
- the session.
-
getSessionCount
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
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
Get the answers of a session.- Parameters:
sessionId
- the session ID.- Returns:
- the session answers.
-
addSession
Insert a session with its answers.- Parameters:
session
- the session.- Throws:
SQLException
- if a database access error occurs
-
deleteSession
Delete a session with its answers.- Parameters:
sessionId
- the session ID.
-
deleteSessions
Delete sessions related to a given survey.- Parameters:
surveyId
- the survey ID.
-
getStatementSuffix
Get the statement name suffix, depending of the DBMS family.- Parameters:
connection
- the connection.- Returns:
- the statement suffix.
-