Package edu.pdx.cs.joy.jdbc
Interface AcademicTermDAO
- All Known Implementing Classes:
AcademicTermDAOImpl
public interface AcademicTermDAO
Data Access Object interface for managing AcademicTerm entities in the database.
-
Method Summary
Modifier and TypeMethodDescriptionvoiddelete(int id) Deletes an academic term from the database by ID.findAll()Finds all academic terms in the database.findById(int id) Finds an academic term by its ID.findByName(String name) Finds an academic term by its name.voidsave(AcademicTerm term) Saves an academic term to the database.voidupdate(AcademicTerm term) Updates an existing academic term in the database.
-
Method Details
-
save
Saves an academic term to the database. The term's ID will be automatically generated by the database and set on the object.- Parameters:
term- the academic term to save- Throws:
SQLException- if a database error occurs
-
findById
Finds an academic term by its ID.- Parameters:
id- the ID to search for- Returns:
- the academic term with the given ID, or null if not found
- Throws:
SQLException- if a database error occurs
-
findByName
Finds an academic term by its name.- Parameters:
name- the name to search for- Returns:
- the academic term with the given name, or null if not found
- Throws:
SQLException- if a database error occurs
-
findAll
Finds all academic terms in the database.- Returns:
- a list of all academic terms
- Throws:
SQLException- if a database error occurs
-
update
Updates an existing academic term in the database. Uses the term's ID to identify which record to update.- Parameters:
term- the academic term to update- Throws:
SQLException- if a database error occurs
-
delete
Deletes an academic term from the database by ID.- Parameters:
id- the ID of the academic term to delete- Throws:
SQLException- if a database error occurs
-