/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
package DB;

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

/**
 * The persistent class for the lecture database table.
 * 
 */
@Entity
@Table(name = "lecture")
@NamedQuery(name = "Lecture.findAll", query = "SELECT l FROM Lecture l")
public class Lecture implements Serializable {
  private static final long serialVersionUID = 1L;
  private LecturePK id;
  private Course courseBean;
  private List<StudentAttendance> studentAttendances;

  public Lecture() {
  }

  @EmbeddedId
  public LecturePK getId() {
    return this.id;
  }

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

  // bi-directional many-to-one association to Course
  @ManyToOne
  @JoinColumn(name = "course", nullable = false, insertable = false, updatable = false)
  public Course getCourseBean() {
    return this.courseBean;
  }

  public void setCourseBean(Course courseBean) {
    this.courseBean = courseBean;
  }

  // bi-directional many-to-one association to StudentAttendance
  @OneToMany(mappedBy = "lecture")
  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.setLecture(this);

    return studentAttendance;
  }

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

    return studentAttendance;
  }

}