Class MatchDAO

java.lang.Object
com.ubs.backend.classes.database.dao.DAO<Match>
com.ubs.backend.classes.database.dao.MatchDAO

public class MatchDAO extends DAO<Match>
DAO for com.ubs.backend.classes.database.Match
  • Constructor Details

    • MatchDAO

      public MatchDAO()
  • Method Details

    • selectByTagAndWord

      public Match selectByTagAndWord(long tagId, String word, javax.persistence.EntityManager em)
      Parameters:
      tagId -
      word -
      em -
      Returns:
      Since:
      21.07.2021
    • selectByWord

      public Match selectByWord(String word, javax.persistence.EntityManager em)
    • autoInsert

      public Match autoInsert(Match trans, javax.persistence.EntityManager em)
      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 checked
      em - 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 voted
      answerID -
      isUpvote - if the vote is positive
      revert -
      question -
      em -
      Since:
      17.07.2021
    • resetRatings

      public Match resetRatings(long id, javax.persistence.EntityManager em)