com.stratelia.webactiv.util.question.ejb
Class QuestionDAO

java.lang.Object
  extended by com.stratelia.webactiv.util.question.ejb.QuestionDAO

public class QuestionDAO
extends Object

This class is made to access database only (table SB_Question_Question)

Author:
neysseri

Field Summary
static String QUESTIONCOLUMNNAMES
           
 
Constructor Summary
QuestionDAO()
           
 
Method Summary
static QuestionPK createQuestion(Connection con, Question question)
          Create a new question
static void deleteQuestion(Connection con, QuestionPK questionPK)
          Delete a question
static void deleteQuestionsByFatherPK(Connection con, QuestionPK questionPK, String fatherId)
          Delete all questions linked to a given father
static Question getQuestion(Connection con, QuestionPK questionPK)
          Return a question
static Collection<Question> getQuestionsByFatherPK(Connection con, QuestionPK questionPK, String fatherId)
          Return the questions linked to a given father
static void updateQuestion(Connection con, Question question)
          Update a question
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

QUESTIONCOLUMNNAMES

public static final String QUESTIONCOLUMNNAMES
See Also:
Constant Field Values
Constructor Detail

QuestionDAO

public QuestionDAO()
Method Detail

getQuestion

public static Question getQuestion(Connection con,
                                   QuestionPK questionPK)
                            throws SQLException
Return a question

Parameters:
con - the Connection to dataBase
questionPK - the question id
Returns:
a Question
Throws:
SQLException

getQuestionsByFatherPK

public static Collection<Question> getQuestionsByFatherPK(Connection con,
                                                          QuestionPK questionPK,
                                                          String fatherId)
                                                   throws SQLException
Return the questions linked to a given father

Parameters:
con - the Connection to dataBase
questionPK - the question id
fatherId - the father id
Returns:
a Collection of Question
Throws:
SQLException

createQuestion

public static QuestionPK createQuestion(Connection con,
                                        Question question)
                                 throws SQLException
Create a new question

Parameters:
con - the Connection to dataBase
question - the Question to create
Returns:
the QuestionPK of the new question
Throws:
SQLException

updateQuestion

public static void updateQuestion(Connection con,
                                  Question question)
                           throws SQLException
Update a question

Parameters:
con - the Connection to dataBase
question - the Question to update
Throws:
SQLException

deleteQuestion

public static void deleteQuestion(Connection con,
                                  QuestionPK questionPK)
                           throws SQLException
Delete a question

Parameters:
con - the Connection to dataBase
questionPK - the question id
Throws:
SQLException

deleteQuestionsByFatherPK

public static void deleteQuestionsByFatherPK(Connection con,
                                             QuestionPK questionPK,
                                             String fatherId)
                                      throws SQLException
Delete all questions linked to a given father

Parameters:
con - the Connection to dataBase
questionPK - to know the context
fatherId - the father id
Throws:
SQLException


Copyright © 2016 Silverpeas. All Rights Reserved.