java.lang.Object
edu.ntnu.idatt1002.k1g4.dao.CupDAO

public class CupDAO extends Object
The Database Access Object for the class Cup.
Version:
0.2
Author:
Callum Gran
  • Constructor Details

    • CupDAO

      public CupDAO()
  • Method Details

    • getCups

      public ArrayList<Cup> getCups()
      Gets all cups.
      Returns:
      cups ArrayList: All saved cups
    • getCupByObject

      public Cup getCupByObject(Cup cup)
      Gets cup based on an already existing cup without an id.
      Parameters:
      cup - Cup: The cup to fetch from the database.
      Returns:
      cup Cup: the cup from the database
    • addCup

      public void addCup(Cup cup)
      Method to add a cup to the database.
      Parameters:
      cup - Cup: The cup to be added to the database
    • deleteCup

      public void deleteCup(int cupId)
      Method to delete a cup from the database.
      Parameters:
      cupId - int: the id of the cup to be deleted