Package edu.pdx.cs.joy.jdbc
Class Department
java.lang.Object
edu.pdx.cs.joy.jdbc.Department
Represents a department in a college course catalog.
Each department has a unique ID and a name.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new Department with no initial values.Department(int id, String name) Creates a new Department with the specified ID and name.Department(String name) Creates a new Department with the specified name. -
Method Summary
-
Constructor Details
-
Department
Creates a new Department with the specified ID and name.- Parameters:
id- the unique identifier for the departmentname- the name of the department
-
Department
Creates a new Department with the specified name. The ID will be auto-generated when the department is saved to the database.- Parameters:
name- the name of the department
-
Department
public Department()Creates a new Department with no initial values. Useful for frameworks that use reflection.
-
-
Method Details
-
getId
Returns the ID of this department.- Returns:
- the department ID
-
setId
Sets the ID of this department.- Parameters:
id- the department ID
-
getName
Returns the name of this department.- Returns:
- the department name
-
setName
Sets the name of this department.- Parameters:
name- the department name
-
toString
-
equals
-
hashCode
-