Class ResultDAO
DAO for com.ubs.backend.classes.database.Result
- Since:
- 17.07.2021
- Author:
- Marc, Magnus, Tim Irmler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidremoveByAnswer(long id)voidremoveByAnswer(long id, javax.persistence.EntityManager em)removes all results with specified answervoidremoveTag(long id, javax.persistence.EntityManager em)voidremoveTagFromAnswer(long answerID, long tagID)Removes a tag from an answervoidremoveTagFromAnswer(long answerID, long tagID, javax.persistence.EntityManager em)removes result set that has the specified answer and tagselectByAnswer(long id)Select by answer list.selectByAnswer(long id, int max, javax.persistence.EntityManager em)Select by answer list.selectByAnswer(long id, javax.persistence.EntityManager em)Select by answer list.selectByAnswerAndType(long id, AnswerType type, javax.persistence.EntityManager em)selects all result sets that have the specified answer, with the specified typeselectByTag(long id)selectByTag(long id, javax.persistence.EntityManager em)get all results that have the specified tagselectByTagAndAnswer(long answerId, long tagId, javax.persistence.EntityManager em)selects a single result, that has the specified answer and tagselectByTagAndType(long tagId, AnswerType type, javax.persistence.EntityManager em)selectByType(AnswerType type, javax.persistence.EntityManager em)Select by type list.voidview(ResultParent result)Adds a usage to a Resultvoidvote(long answerID, Long tagID, boolean isUpvote, boolean revert, String question, javax.persistence.EntityManager em)Votes a Result
-
Constructor Details
-
ResultDAO
public ResultDAO()
-
-
Method Details
-
selectByAnswer
Select by answer list.- Parameters:
id- the idmax- the maxem- the em- Returns:
- list
- Since:
- 17.07.2021
-
selectByAnswer
Select by answer list.- Parameters:
id- the idem- the em- Returns:
- list
- Since:
- 17.07.2021
-
selectByAnswer
Select by answer list.- Parameters:
id- the id- Returns:
- list
- Since:
- 17.07.2021
-
selectByType
Select by type list.- Parameters:
type- the typeem- the em- Returns:
- list
- Since:
- 17.07.2021
-
selectByAnswerAndType
public List<Result> selectByAnswerAndType(long id, AnswerType type, javax.persistence.EntityManager em)selects all result sets that have the specified answer, with the specified type- Parameters:
id- the id of the answertype- the answer typeem- the entity manager- Returns:
- all result sets that have the specified answer with the specified type
- Since:
- 17.07.2021
-
selectByTagAndAnswer
selects a single result, that has the specified answer and tag- Parameters:
answerId- the id of the answertagId- the id of the tagem- the entity manager- Returns:
- selects a single result, that has the specified answer and tag
- Since:
- 17.07.2021
-
selectByTagAndType
public List<Result> selectByTagAndType(long tagId, AnswerType type, javax.persistence.EntityManager em) -
selectByTag
get all results that have the specified tag- Parameters:
id- the id of the tagem- the entity manager- Returns:
- all results that have the specified tag
- Since:
- 17.07.2021
-
selectByTag
- Parameters:
id-- Returns:
- Since:
- 17.07.2021
-
view
Adds a usage to a Result- Parameters:
result- the result which should receive a usage- Since:
- 17.07.2021
-
removeByAnswer
public void removeByAnswer(long id)- Parameters:
id-- Since:
- 17.07.2021
-
removeByAnswer
public void removeByAnswer(long id, javax.persistence.EntityManager em)removes all results with specified answer- Parameters:
id- the id of the answerem- the EntityManager- Since:
- 17.07.2021
-
removeTagFromAnswer
public void removeTagFromAnswer(long answerID, long tagID)Removes a tag from an answer- Parameters:
answerID- the ID of the answertagID- the ID of the tag- Since:
- 17.07.2021
-
removeTagFromAnswer
public void removeTagFromAnswer(long answerID, long tagID, javax.persistence.EntityManager em)removes result set that has the specified answer and tag- Parameters:
answerID- the id of the answertagID- the id of the tagem- the entity manager- Since:
- 17.07.2021
-
removeTag
public void removeTag(long id, javax.persistence.EntityManager em)- Parameters:
id-em-- Since:
- 19.07.2021
-
vote
public void vote(long answerID, Long tagID, boolean isUpvote, boolean revert, String question, javax.persistence.EntityManager em)Votes a Result- Parameters:
answerID- the ID of the AnswertagID- the ID of the TagisUpvote- if the vote is positive- Since:
- 17.07.2021
-