Package com.rit.dca.pubpaper.dao
Class PaperSubjectDAO
java.lang.Object
com.rit.dca.pubpaper.dao.PaperSubjectDAO
public class PaperSubjectDAO
extends java.lang.Object
Database Connectivity and Access
-
Field Summary
Fields Modifier and Type Field Description private UserDAO
userAccess
-
Constructor Summary
Constructors Constructor Description PaperSubjectDAO(UserDAO userAccess)
-
Method Summary
Modifier and Type Method Description int
addPaperSubject(int paperId, int[] subjectIds)
Add a new paper subject to the database (submitter or ADMIN)int
deletePaperSubjects(int paperId)
Delete a paper subject from the database (only ADMIN)int
deleteSinglePaperSubject(int paperId, int subjectId)
Delete a single paper subject from the database (only ADMIN)int
deleteSubjectPapers(int subjectId)
Delete a subject's paper from the database (only ADMIN)java.util.ArrayList<Subject>
getPaperSubjects(int paperId)
Gives a list of subject instances for paper idint
updatePaperSubject(int paperId, int subjectId)
Update a paper subject in the database (submitter or ADMIN)
-
Field Details
-
Constructor Details
-
Method Details
-
getPaperSubjects
Gives a list of subject instances for paper id- Parameters:
paperId
- for which subjects are required- Returns:
- array list of subjects for paperId provided
- Throws:
PubPaperException
-
addPaperSubject
Add a new paper subject to the database (submitter or ADMIN)- Parameters:
paperId
- paperId to be added to the databasesubjectIds
- subjectIds to be paired with paper id to insert- Returns:
- int number of rows affected
- Throws:
PubPaperException
-
updatePaperSubject
Update a paper subject in the database (submitter or ADMIN)- Parameters:
paperId
- paperId to be update in the databasesubjectId
- subjectId to be to be replaced with in the database- Returns:
- int number of rows affected
- Throws:
PubPaperException
-
deletePaperSubjects
Delete a paper subject from the database (only ADMIN)- Parameters:
paperId
- paperId of the paper to be deleted from the database- Returns:
- int number of rows affected
- Throws:
PubPaperException
-
deleteSubjectPapers
Delete a subject's paper from the database (only ADMIN)- Parameters:
subjectId
- subjectId of the subject to be deleted from the database- Returns:
- int number of rows affected
- Throws:
PubPaperException
-
deleteSinglePaperSubject
Delete a single paper subject from the database (only ADMIN)- Parameters:
subjectId
- subjectId of the subject to be deleted from the database- Returns:
- int number of rows affected
- Throws:
PubPaperException
-