Class QuestionContainerDAO
- java.lang.Object
-
- org.silverpeas.core.questioncontainer.container.dao.QuestionContainerDAO
-
public class QuestionContainerDAO extends Object
This class is made to access database only (table SB_QuestionContainer_QC and SB_QuestionContainer_Comment)- Author:
- neysseri
-
-
Field Summary
Fields Modifier and Type Field Description static String
COMMENTCOLUMNNAMES
static String
QUESTIONCONTAINERCOLUMNNAMES
-
Method Summary
-
-
-
Field Detail
-
QUESTIONCONTAINERCOLUMNNAMES
public static final String QUESTIONCONTAINERCOLUMNNAMES
- See Also:
- Constant Field Values
-
COMMENTCOLUMNNAMES
public static final String COMMENTCOLUMNNAMES
- See Also:
- Constant Field Values
-
-
Method Detail
-
getQuestionContainers
public static Collection<QuestionContainerHeader> getQuestionContainers(Connection con, QuestionContainerPK questionContainerPK) throws SQLException
- Parameters:
con
- the database connectionquestionContainerPK
-- Returns:
- a collection of Question Container Header
- Throws:
SQLException
-
getQuestionContainers
public static Collection<QuestionContainerHeader> getQuestionContainers(Connection con, List<QuestionContainerPK> pks) throws SQLException
- Throws:
SQLException
-
getOpenedQuestionContainers
public static Collection<QuestionContainerHeader> getOpenedQuestionContainers(Connection con, QuestionContainerPK questionContainerPK) throws SQLException
- Parameters:
con
- the database connectionquestionContainerPK
-- Returns:
- Throws:
SQLException
-
getNotClosedQuestionContainers
public static Collection<QuestionContainerHeader> getNotClosedQuestionContainers(Connection con, QuestionContainerPK questionContainerPK) throws SQLException
Method declaration- Parameters:
con
- the database connectionquestionContainerPK
-- Returns:
- Throws:
SQLException
-
getClosedQuestionContainers
public static Collection<QuestionContainerHeader> getClosedQuestionContainers(Connection con, QuestionContainerPK questionContainerPK) throws SQLException
- Parameters:
con
- the database connectionquestionContainerPK
-- Returns:
- Throws:
SQLException
-
getInWaitQuestionContainers
public static Collection<QuestionContainerHeader> getInWaitQuestionContainers(Connection con, QuestionContainerPK qcPK) throws SQLException
- Parameters:
con
- the database connectionqcPK
-- Returns:
- Throws:
SQLException
-
getQuestionContainerHeader
public static QuestionContainerHeader getQuestionContainerHeader(Connection con, QuestionContainerPK questionContainerPK) throws SQLException
- Parameters:
con
- the database connectionquestionContainerPK
-- Returns:
- Throws:
SQLException
-
closeQuestionContainer
public static void closeQuestionContainer(Connection con, QuestionContainerPK questionContainerPK) throws SQLException
- Parameters:
con
- the database connectionquestionContainerPK
-- Throws:
SQLException
-
openQuestionContainer
public static void openQuestionContainer(Connection con, QuestionContainerPK questionContainerPK) throws SQLException
- Parameters:
con
- the database connectionquestionContainerPK
-- Throws:
SQLException
-
createQuestionContainerHeader
public static QuestionContainerPK createQuestionContainerHeader(Connection con, QuestionContainerHeader questionContainerHeader) throws SQLException
- Parameters:
con
- the database connectionquestionContainerHeader
-- Returns:
- Throws:
SQLException
-
updateQuestionContainerHeader
public static void updateQuestionContainerHeader(Connection con, QuestionContainerHeader questionContainerHeader) throws SQLException
- Parameters:
con
- the database connectionquestionContainerHeader
-- Throws:
SQLException
-
deleteQuestionContainerHeader
public static void deleteQuestionContainerHeader(Connection con, QuestionContainerPK questionContainerPK) throws SQLException
- Parameters:
con
- the database connectionquestionContainerPK
-- Throws:
SQLException
-
addAVoter
public static void addAVoter(Connection con, QuestionContainerPK questionContainerPK) throws SQLException
- Parameters:
con
- the database connectionquestionContainerPK
-- Throws:
SQLException
-
addComment
public static void addComment(Connection con, Comment comment) throws SQLException
Add a comment- Parameters:
con
- the database connectioncomment
- the comment to add- Throws:
SQLException
-
getComments
public static Collection<Comment> getComments(Connection con, QuestionContainerPK qcPK) throws SQLException
Retrieve the list of comments from question container primary key- Parameters:
con
- the database connectionqcPK
- the question container identifier- Returns:
- a collection of comment
- Throws:
SQLException
-
deleteComments
public static void deleteComments(Connection con, QuestionContainerPK qcPK) throws SQLException
Delete comments identified with given parameter question container identifier- Parameters:
con
- the database connectionqcPK
- the question container identifier- Throws:
SQLException
-
deleteAllQuestionContainersByInstanceId
public static void deleteAllQuestionContainersByInstanceId(Connection con, String instanceId) throws SQLException
Deletes all the question containers and as well their comments that were created for the specified component instance.- Parameters:
con
- the connection to the data source in which are stored both the question containers and the comments.instanceId
- the unique identifier of the component instance.- Throws:
SQLException
- if an error occurs while deleting the question containers or their comments.
-
-