001package edu.pdx.cs.joy.jdbc;
002
003import java.sql.SQLException;
004import java.util.List;
005
006/**
007 * Data Access Object interface for managing AcademicTerm entities in the database.
008 */
009public interface AcademicTermDAO {
010
011  /**
012   * Saves an academic term to the database.
013   * The term's ID will be automatically generated by the database and set on the object.
014   *
015   * @param term the academic term to save
016   * @throws SQLException if a database error occurs
017   */
018  void save(AcademicTerm term) throws SQLException;
019
020  /**
021   * Finds an academic term by its ID.
022   *
023   * @param id the ID to search for
024   * @return the academic term with the given ID, or null if not found
025   * @throws SQLException if a database error occurs
026   */
027  AcademicTerm findById(int id) throws SQLException;
028
029  /**
030   * Finds an academic term by its name.
031   *
032   * @param name the name to search for
033   * @return the academic term with the given name, or null if not found
034   * @throws SQLException if a database error occurs
035   */
036  AcademicTerm findByName(String name) throws SQLException;
037
038  /**
039   * Finds all academic terms in the database.
040   *
041   * @return a list of all academic terms
042   * @throws SQLException if a database error occurs
043   */
044  List<AcademicTerm> findAll() throws SQLException;
045
046  /**
047   * Updates an existing academic term in the database.
048   * Uses the term's ID to identify which record to update.
049   *
050   * @param term the academic term to update
051   * @throws SQLException if a database error occurs
052   */
053  void update(AcademicTerm term) throws SQLException;
054
055  /**
056   * Deletes an academic term from the database by ID.
057   *
058   * @param id the ID of the academic term to delete
059   * @throws SQLException if a database error occurs
060   */
061  void delete(int id) throws SQLException;
062}
063