/magstudentportal/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/magstudentportal/trunk

« back to all changes in this revision

Viewing changes to src/main/java/db/Student.java

  • Committer: Gustav Hartvigsson
  • Date: 2017-08-28 14:01:22 UTC
  • mfrom: (15.1.10 magstudentportal-more-db)
  • Revision ID: gustav.hartvigsson@gmail.com-20170828140122-dfqs6oxweh0zjzlj
* Merged stuff into trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
import javax.persistence.*;
5
5
import java.util.List;
6
6
 
7
 
 
8
7
/**
9
8
 * The persistent class for the student database table.
10
9
 * 
11
10
 */
12
11
@Entity
13
 
@Table(name="student")
14
 
@NamedQuery(name="Student.findAll", query="SELECT s FROM Student s")
 
12
@Table(name = "student")
 
13
@NamedQuery(name = "Student.findAll", query = "SELECT s FROM Student s")
15
14
public class Student implements Serializable {
16
 
        private static final long serialVersionUID = 1L;
17
 
        private Integer id;
18
 
        private String class_;
19
 
        private String nameFirst;
20
 
        private String nameLast;
21
 
        private String pwd;
22
 
        private String userName;
23
 
        private List<StudentAttendance> studentAttendances;
24
 
 
25
 
        public Student() {
26
 
        }
27
 
 
28
 
 
29
 
        @Id
30
 
        @GeneratedValue(strategy=GenerationType.AUTO)
31
 
        @Column(unique=true, nullable=false)
32
 
        public Integer getId() {
33
 
                return this.id;
34
 
        }
35
 
 
36
 
        public void setId(Integer id) {
37
 
                this.id = id;
38
 
        }
39
 
 
40
 
 
41
 
        @Column(name="class", length=32)
42
 
        public String getClass_() {
43
 
                return this.class_;
44
 
        }
45
 
 
46
 
        public void setClass_(String class_) {
47
 
                this.class_ = class_;
48
 
        }
49
 
 
50
 
 
51
 
        @Column(name="name_first", nullable=false, length=32)
52
 
        public String getNameFirst() {
53
 
                return this.nameFirst;
54
 
        }
55
 
 
56
 
        public void setNameFirst(String nameFirst) {
57
 
                this.nameFirst = nameFirst;
58
 
        }
59
 
 
60
 
 
61
 
        @Column(name="name_last", nullable=false, length=32)
62
 
        public String getNameLast() {
63
 
                return this.nameLast;
64
 
        }
65
 
 
66
 
        public void setNameLast(String nameLast) {
67
 
                this.nameLast = nameLast;
68
 
        }
69
 
 
70
 
 
71
 
        @Column(nullable=false, length=256)
72
 
        public String getPwd() {
73
 
                return this.pwd;
74
 
        }
75
 
 
76
 
        public void setPwd(String pwd) {
77
 
                this.pwd = pwd;
78
 
        }
79
 
 
80
 
 
81
 
        @Column(name="user_name", nullable=false, length=32)
82
 
        public String getUserName() {
83
 
                return this.userName;
84
 
        }
85
 
 
86
 
        public void setUserName(String userName) {
87
 
                this.userName = userName;
88
 
        }
89
 
 
90
 
 
91
 
        //bi-directional many-to-one association to StudentAttendance
92
 
        @OneToMany(mappedBy="studentBean")
93
 
        public List<StudentAttendance> getStudentAttendances() {
94
 
                return this.studentAttendances;
95
 
        }
96
 
 
97
 
        public void setStudentAttendances(List<StudentAttendance> studentAttendances) {
98
 
                this.studentAttendances = studentAttendances;
99
 
        }
100
 
 
101
 
        public StudentAttendance addStudentAttendance(StudentAttendance studentAttendance) {
102
 
                getStudentAttendances().add(studentAttendance);
103
 
                studentAttendance.setStudentBean(this);
104
 
 
105
 
                return studentAttendance;
106
 
        }
107
 
 
108
 
        public StudentAttendance removeStudentAttendance(StudentAttendance studentAttendance) {
109
 
                getStudentAttendances().remove(studentAttendance);
110
 
                studentAttendance.setStudentBean(null);
111
 
 
112
 
                return studentAttendance;
113
 
        }
 
15
  private static final long serialVersionUID = 1L;
 
16
  private Integer id;
 
17
  private String class_;
 
18
  private String nameFirst;
 
19
  private String nameLast;
 
20
  private String pwd;
 
21
  private String userName;
 
22
  private List<StudentAttendance> studentAttendances;
 
23
 
 
24
  public Student() {
 
25
  }
 
26
 
 
27
  @Id
 
28
  @GeneratedValue(strategy = GenerationType.AUTO)
 
29
  @Column(unique = true, nullable = false)
 
30
  public Integer getId() {
 
31
    return this.id;
 
32
  }
 
33
 
 
34
  public void setId(Integer id) {
 
35
    this.id = id;
 
36
  }
 
37
 
 
38
  @Column(name = "class", length = 32)
 
39
  public String getClass_() {
 
40
    return this.class_;
 
41
  }
 
42
 
 
43
  public void setClass_(String class_) {
 
44
    this.class_ = class_;
 
45
  }
 
46
 
 
47
  @Column(name = "name_first", nullable = false, length = 32)
 
48
  public String getNameFirst() {
 
49
    return this.nameFirst;
 
50
  }
 
51
 
 
52
  public void setNameFirst(String nameFirst) {
 
53
    this.nameFirst = nameFirst;
 
54
  }
 
55
 
 
56
  @Column(name = "name_last", nullable = false, length = 32)
 
57
  public String getNameLast() {
 
58
    return this.nameLast;
 
59
  }
 
60
 
 
61
  public void setNameLast(String nameLast) {
 
62
    this.nameLast = nameLast;
 
63
  }
 
64
 
 
65
  @Column(nullable = false, length = 256)
 
66
  public String getPwd() {
 
67
    return this.pwd;
 
68
  }
 
69
 
 
70
  public void setPwd(String pwd) {
 
71
    this.pwd = pwd;
 
72
  }
 
73
 
 
74
  @Column(name = "user_name", nullable = false, length = 32)
 
75
  public String getUserName() {
 
76
    return this.userName;
 
77
  }
 
78
 
 
79
  public void setUserName(String userName) {
 
80
    this.userName = userName;
 
81
  }
 
82
 
 
83
  // bi-directional many-to-one association to StudentAttendance
 
84
  @OneToMany(mappedBy = "studentBean")
 
85
  public List<StudentAttendance> getStudentAttendances() {
 
86
    return this.studentAttendances;
 
87
  }
 
88
 
 
89
  public void setStudentAttendances(List<StudentAttendance> studentAttendances) {
 
90
    this.studentAttendances = studentAttendances;
 
91
  }
 
92
 
 
93
  public StudentAttendance addStudentAttendance(StudentAttendance studentAttendance) {
 
94
    getStudentAttendances().add(studentAttendance);
 
95
    studentAttendance.setStudentBean(this);
 
96
 
 
97
    return studentAttendance;
 
98
  }
 
99
 
 
100
  public StudentAttendance removeStudentAttendance(StudentAttendance studentAttendance) {
 
101
    getStudentAttendances().remove(studentAttendance);
 
102
    studentAttendance.setStudentBean(null);
 
103
 
 
104
    return studentAttendance;
 
105
  }
114
106
 
115
107
}
 
 
b'\\ No newline at end of file'