Class MatchDAO
DAO for com.ubs.backend.classes.database.Match
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionautoInsert(Match trans, javax.persistence.EntityManager em)Checks if a Match already exists and if it doesn't insert it into the DatabasevoidremoveByTag(long tagId, javax.persistence.EntityManager em)resetRatings(long id, javax.persistence.EntityManager em)selectByTagAndWord(long tagId, String word, javax.persistence.EntityManager em)selectByWord(String word, javax.persistence.EntityManager em)voidvote(Long matchID, Long answerID, boolean isUpvote, boolean revert, String question, javax.persistence.EntityManager em)Votes a Tag
-
Constructor Details
-
MatchDAO
public MatchDAO()
-
-
Method Details
-
selectByTagAndWord
- Parameters:
tagId-word-em-- Returns:
- Since:
- 21.07.2021
-
selectByWord
-
autoInsert
Checks if a Match already exists and if it doesn't insert it into the Database- Parameters:
trans- the Match which is going to be checkedem- the EntityManager- Returns:
- how many matches there are
-
removeByTag
public void removeByTag(long tagId, javax.persistence.EntityManager em)- Parameters:
tagId-em-- Since:
- 30.07.2021
-
vote
public void vote(Long matchID, Long answerID, boolean isUpvote, boolean revert, String question, javax.persistence.EntityManager em)Votes a Tag- Parameters:
matchID- the Tag which is being votedanswerID-isUpvote- if the vote is positiverevert-question-em-- Since:
- 17.07.2021
-
resetRatings
-