1 package ejava.examples.webtier.bo;
2
3 import java.util.ArrayList;
4 import java.util.List;
5
6 public class Student extends Person {
7 private static final long serialVersionUID = 1L;
8 private List<Grade> grades = new ArrayList<Grade>();
9
10 public Student() {}
11 public Student(long id) { super(id); }
12 public Student(
13 long id, String firstName, String lastName, List<Grade> grades) {
14 super(id, firstName, lastName);
15 setGrades(grades);
16 }
17
18 public List<Grade> getGrades() {
19 return grades;
20 }
21 public void setGrades(List<Grade> grades) {
22 this.grades = grades;
23 }
24
25 public String toString() {
26 StringBuilder text = new StringBuilder();
27 text.append(super.toString());
28 text.append(", grades=" + grades);
29 return text.toString();
30 }
31 }