/magstudentportal/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/magstudentportal/trunk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/* c-basic-offset: 2; tab-width: 2; indent-tabs-mode: nil
 * vi: set shiftwidth=2 tabstop=2 expandtab:
 * :indentSize=2:tabSize=2:noTabs=true:
 */

package DB;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;

/**
 * The persistent class for the student database table.
 * 
 */
@Entity
@Table(name = "student")
@NamedQuery(name = "Student.findAll", query = "SELECT s FROM Student s")
public class Student implements Serializable {
  private static final long serialVersionUID = 1L;
  private Integer id;
  private String class_;
  private String nameFirst;
  private String nameLast;
  private String pwd;
  private String userName;
  private List<StudentAttendance> studentAttendances;

  public Student() {
  }

  @Id
  @GeneratedValue(strategy = GenerationType.AUTO)
  @Column(unique = true, nullable = false)
  public Integer getId() {
    return this.id;
  }

  public void setId(Integer id) {
    this.id = id;
  }

  @Column(name = "class", length = 32)
  public String getClass_() {
    return this.class_;
  }

  public void setClass_(String class_) {
    this.class_ = class_;
  }

  @Column(name = "name_first", nullable = false, length = 32)
  public String getNameFirst() {
    return this.nameFirst;
  }

  public void setNameFirst(String nameFirst) {
    this.nameFirst = nameFirst;
  }

  @Column(name = "name_last", nullable = false, length = 32)
  public String getNameLast() {
    return this.nameLast;
  }

  public void setNameLast(String nameLast) {
    this.nameLast = nameLast;
  }

  @Column(nullable = false, length = 256)
  public String getPwd() {
    return this.pwd;
  }

  public void setPwd(String pwd) {
    this.pwd = pwd;
  }

  @Column(name = "user_name", nullable = false, length = 32)
  public String getUserName() {
    return this.userName;
  }

  public void setUserName(String userName) {
    this.userName = userName;
  }

  // bi-directional many-to-one association to StudentAttendance
  @OneToMany(mappedBy = "studentBean")
  public List<StudentAttendance> getStudentAttendances() {
    return this.studentAttendances;
  }

  public void setStudentAttendances(List<StudentAttendance> studentAttendances) {
    this.studentAttendances = studentAttendances;
  }

  public StudentAttendance addStudentAttendance(StudentAttendance studentAttendance) {
    getStudentAttendances().add(studentAttendance);
    studentAttendance.setStudentBean(this);

    return studentAttendance;
  }

  public StudentAttendance removeStudentAttendance(StudentAttendance studentAttendance) {
    getStudentAttendances().remove(studentAttendance);
    studentAttendance.setStudentBean(null);

    return studentAttendance;
  }

}