Package com.rit.dca.pubpaper.dao
Class PaperAuthorDAO
java.lang.Object
com.rit.dca.pubpaper.dao.PaperAuthorDAO
public class PaperAuthorDAO
extends java.lang.Object
Database Connectivity and Access
-
Field Summary
Fields Modifier and Type Field Description private UserDAO
userAccess
-
Constructor Summary
Constructors Constructor Description PaperAuthorDAO(UserDAO userAccess)
-
Method Summary
Modifier and Type Method Description int
addPaperAuthor(int paperId, int userId, int displayOrder)
Adds new paper author in the database (submitter and ADMIN)int
deleteAuthorPapers(int userId)
Delete an author's paper from the database (only ADMIN)int
deletePaperAuthors(int paperId)
Delete a paper author from the database (only ADMIN)int
deleteSinglePaperAuthor(int paperId, int userId)
Delete a single paper author from the database (only ADMIN)java.util.ArrayList<java.lang.Integer>
getAuthorPapers(int userId)
Gives a list of paper ids for user id providedint
getDisplayOrder(int paperId, int userId)
Gives the display order for a combination of paper and user idsjava.util.ArrayList<java.lang.Integer>
getPaperAuthors(int paperId)
Gives a list of author ids for a paper id ordered according to displayOrderint
updatePaperAuthor(int paperId, int userId, int displayOrder)
Updates existing paper author in the database (submitter and ADMIN)
-
Field Details
-
Constructor Details
-
Method Details
-
getPaperAuthors
public java.util.ArrayList<java.lang.Integer> getPaperAuthors(int paperId) throws PubPaperExceptionGives a list of author ids for a paper id ordered according to displayOrder- Parameters:
paperId
- for which paper authors are required- Returns:
- array list of author ids for paperId provided
- Throws:
PubPaperException
-
getAuthorPapers
Gives a list of paper ids for user id provided- Parameters:
userId
- for which papers are required- Returns:
- array list of paper ids for userId provided
- Throws:
PubPaperException
-
getDisplayOrder
Gives the display order for a combination of paper and user ids- Parameters:
paperId
- paperId to be searcheduserId
- userId to be searched- Returns:
- int displayOrder of the combination
- Throws:
PubPaperException
-
addPaperAuthor
Adds new paper author in the database (submitter and ADMIN)- Parameters:
paperId
- paperId to be addeduserId
- userId to be addeddisplayOrder
- displayOrder to be added- Returns:
- int number of rows affected
- Throws:
PubPaperException
-
updatePaperAuthor
Updates existing paper author in the database (submitter and ADMIN)- Parameters:
paperId
- paperId to be updateduserId
- userId to be updateddisplayOrder
- displayOrder to be updated- Returns:
- int number of rows affected
- Throws:
PubPaperException
-
deletePaperAuthors
Delete a paper author from the database (only ADMIN)- Parameters:
paperId
- paperId of the paper author to be deleted from the database- Returns:
- int number of rows affected
- Throws:
PubPaperException
-
deleteAuthorPapers
Delete an author's paper from the database (only ADMIN)- Parameters:
userId
- userId of the author to be deleted from the database- Returns:
- int number of rows affected
- Throws:
PubPaperException
-
deleteSinglePaperAuthor
Delete a single paper author from the database (only ADMIN)- Parameters:
paperId
- paperId of the paper to be deleted from the databaseuserId
- userId of the user to be deleted from the database- Returns:
- int number of rows affected
- Throws:
PubPaperException
-