All Known Implementing Classes:
UserDAO

public interface IUserDAO
Defines the interface for a User DAO. Any class implementing IUserDAO must provide implementations for the CRUD methods and other user-related operations in this interface.
Author:
Joshua M.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Creates a new User in the database.
    void
    Deletes a User from the database.
    Retrieves all Users from the database.
    getUser(int id)
    Retrieves a User from the database by their ID.
    getUser(String username)
    Retrieves a User from the database by their username.
    void
    Updates an existing User in the database.
  • Method Details

    • createUser

      void createUser(User user) throws SQLException
      Creates a new User in the database.
      Parameters:
      user - The User to create.
      Throws:
      SQLException - If an SQL error occurs during the operation.
    • updateUser

      void updateUser(User user) throws SQLException
      Updates an existing User in the database.
      Parameters:
      user - The User with updated information.
      Throws:
      SQLException - If an SQL error occurs during the operation.
    • deleteUser

      void deleteUser(User user) throws SQLException
      Deletes a User from the database.
      Parameters:
      user - The User to delete.
      Throws:
      SQLException - If an SQL error occurs during the operation.
    • getUser

      User getUser(int id) throws SQLException
      Retrieves a User from the database by their ID.
      Parameters:
      id - The ID of the User to retrieve.
      Returns:
      The User matching the ID, or null if not found.
      Throws:
      SQLException - If an SQL error occurs during the operation.
    • getUser

      User getUser(String username) throws SQLException
      Retrieves a User from the database by their username.
      Parameters:
      username - The username of the User to retrieve.
      Returns:
      The User matching the username, or null if not found.
      Throws:
      SQLException - If an SQL error occurs during the operation.
    • getAllUsers

      List<User> getAllUsers() throws SQLException
      Retrieves all Users from the database.
      Returns:
      A list of all User objects in the database.
      Throws:
      SQLException - If an SQL error occurs during the operation.