Class ScoreDAO


  • public class ScoreDAO
    extends Object
    Score Data Access Object layer
    • Method Detail

      • deleteScore

        public static void deleteScore​(Connection con,
                                       ScorePK scorePK)
                                throws SQLException
        detele score identified by given scorePk parameter
        Parameters:
        con - the database connection
        scorePK - the score identifier
        Throws:
        SQLException
      • deleteScoreByFatherPK

        public static void deleteScoreByFatherPK​(Connection con,
                                                 String fatherId)
                                          throws SQLException
        Parameters:
        con - the database connection
        fatherId - the father idenfifier
        Throws:
        SQLException
      • deleteAllScoresByInstanceId

        public static void deleteAllScoresByInstanceId​(Connection con,
                                                       String instanceId)
                                                throws SQLException
        Deletes the scores of all the questions in the specified component instance.
        Parameters:
        con - a connection to the data source into which are stored the scores.
        instanceId - the unique identifier of the component instance.
        Throws:
        SQLException - if an error occurs while deleting the scores.
      • getNbVotersByFatherId

        public static int getNbVotersByFatherId​(Connection con,
                                                ScorePK scorePK,
                                                String fatherId)
                                         throws SQLException
        Parameters:
        con - the database connection
        scorePK - the score identifier
        fatherId - the father idenfifier
        Returns:
        Throws:
        SQLException
      • getAverageScoreByFatherId

        public static float getAverageScoreByFatherId​(Connection con,
                                                      ScorePK scorePK,
                                                      String fatherId)
                                               throws SQLException
        Parameters:
        con - the database connection
        scorePK - the score identifier
        fatherId - the father idenfifier
        Returns:
        Throws:
        SQLException
      • getUserScoreByFatherIdAndParticipationId

        public static ScoreDetail getUserScoreByFatherIdAndParticipationId​(Connection con,
                                                                           ScorePK scorePK,
                                                                           String fatherId,
                                                                           String userId,
                                                                           int participationId)
                                                                    throws SQLException
        Parameters:
        con - the database connection
        scorePK - the score identifier
        fatherId - the father idenfifier
        userId - the user identifier
        participationId -
        Returns:
        Throws:
        SQLException
      • getUserNbParticipationsByFatherId

        public static int getUserNbParticipationsByFatherId​(Connection con,
                                                            ScorePK scorePK,
                                                            String fatherId,
                                                            String userId)
                                                     throws SQLException
        Parameters:
        con - the database connection
        scorePK - the score identifier
        fatherId - the father idenfifier
        userId - the user identifier
        Returns:
        Throws:
        SQLException
      • getUserPositionByFatherIdAndParticipationId

        public static int getUserPositionByFatherIdAndParticipationId​(Connection con,
                                                                      ScorePK scorePK,
                                                                      String fatherId,
                                                                      String userId,
                                                                      int participationId)
                                                               throws SQLException
        Parameters:
        con - the database connection
        scorePK - the score identifier
        fatherId -
        userId - the user identifier
        participationId -
        Returns:
        Throws:
        SQLException