public class SurveyAnswerDao extends AbstractMyBatisDAO
Modifier and Type | Field and Description |
---|---|
static String |
ROLE
The Avalon role name.
|
Constructor and Description |
---|
SurveyAnswerDao() |
Modifier and Type | Method and Description |
---|---|
void |
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.
|
List<Map<String,Object>> |
getAllSessionCount()
Get the session count list.
|
List<SurveyAnswer> |
getAnswers(int sessionId)
Get the answers of a session.
|
SurveySession |
getSession(int sessionId)
Get a session from its ID.
|
SurveySession |
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.
|
List<SurveySession> |
getSessions()
Get the exhaustive list of sessions.
|
List<SurveySession> |
getSessions(String surveyId)
Get all the sessions of a given survey.
|
List<SurveySession> |
getSessionsWithAnswers(String surveyId)
Get all the sessions of a given survey, with their answers.
|
SurveySession |
getSessionWithAnswers(int sessionId)
Get a session from its ID.
|
protected String |
getStatementSuffix(Connection connection)
Get the statement name suffix, depending of the DBMS family.
|
configure, contextualize, getSession, getSession, reload, service, setPluginInfo
getLogger, setLogger
public SurveyAnswerDao()
public SurveySession getSession(int sessionId)
sessionId
- the session ID.public SurveySession getSession(String surveyId, UserIdentity user)
surveyId
- the survey ID.user
- the user.public SurveySession getSessionWithAnswers(int sessionId)
sessionId
- the session ID.public int getSessionCount(String surveyId)
surveyId
- the survey ID.public List<Map<String,Object>> getAllSessionCount()
public List<SurveySession> getSessions()
public List<SurveySession> getSessions(String surveyId)
surveyId
- the survey ID.public List<SurveySession> getSessionsWithAnswers(String surveyId)
surveyId
- the survey ID.public List<SurveyAnswer> getAnswers(int sessionId)
sessionId
- the session ID.public void addSession(SurveySession session)
session
- the session.public void deleteSession(String sessionId)
sessionId
- the session ID.public void deleteSessions(String surveyId)
surveyId
- the survey ID.protected String getStatementSuffix(Connection connection)
connection
- the connection.