Class DefaultQuestionDAO

java.lang.Object
com.ubs.backend.classes.database.dao.DAO<DefaultQuestion>
com.ubs.backend.classes.database.dao.questions.DefaultQuestionDAO

public class DefaultQuestionDAO extends DAO<DefaultQuestion>
DAO for com.ubs.backend.classes.database.dao.questions.DefaultQuestion
Since:
17.07.2021
Author:
Sarah Ambi, Tim Irmler
  • Constructor Details

    • DefaultQuestionDAO

      public DefaultQuestionDAO()
  • Method Details

    • selectRandom

      public List<DefaultQuestion> selectRandom(int max, javax.persistence.EntityManager em)
      select random questions
      Parameters:
      max - number of default questions you want
      em -
      Returns:
      the random questions in a arraylist
    • selectRandom

      public List<DefaultQuestion> selectRandom(int max)
    • count

      public Long count(javax.persistence.EntityManager em)
    • update

      public void update(long id, String question)
      Updates a defaultQuestion in the Database
      Parameters:
      id - the id of the defaultquestion
      question - the new Content of the defaultquestion