Class Student

java.lang.Object
org.codewithmagret.rest.student.Student

@Entity public class Student extends Object
Represents a student entity in the system. This class is mapped to a database table using JPA annotations.
  • Constructor Details

    • Student

      public Student()
      Default constructor required by JPA. Initializes a new instance of the Student class.
    • Student

      public Student(String firstName, String lastName)
      Constructs a new Student with the specified first name and last name.
      Parameters:
      firstName - the first name of the student
      lastName - the last name of the student
  • Method Details

    • getId

      public Long getId()
      Gets the unique identifier of the student.
      Returns:
      the ID of the student
    • setId

      public void setId(Long id)
      Sets the unique identifier of the student.
      Parameters:
      id - the ID to set for the student
    • getFirstName

      public String getFirstName()
      Gets the first name of the student.
      Returns:
      the first name of the student
    • setFirstName

      public void setFirstName(String firstName)
      Sets the first name of the student.
      Parameters:
      firstName - the first name to set for the student
    • getLastName

      public String getLastName()
      Gets the last name of the student.
      Returns:
      the last name of the student
    • setLastName

      public void setLastName(String lastName)
      Sets the last name of the student.
      Parameters:
      lastName - the last name to set for the student
    • getCourses

      public List<Course> getCourses()
      Gets the list of courses the student is enrolled in.
      Returns:
      a list of courses the student is enrolled in
    • setCourses

      public void setCourses(List<Course> courses)
      Sets the list of courses the student is enrolled in.
      Parameters:
      courses - a list of courses to set for the student