/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/Lecture.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 lecture database table.
10
9
 * 
11
10
 */
12
11
@Entity
13
 
@Table(name="lecture")
14
 
@NamedQuery(name="Lecture.findAll", query="SELECT l FROM Lecture l")
 
12
@Table(name = "lecture")
 
13
@NamedQuery(name = "Lecture.findAll", query = "SELECT l FROM Lecture l")
15
14
public class Lecture implements Serializable {
16
 
        private static final long serialVersionUID = 1L;
17
 
        private LecturePK id;
18
 
        private Course courseBean;
19
 
        private List<StudentAttendance> studentAttendances;
20
 
 
21
 
        public Lecture() {
22
 
        }
23
 
 
24
 
 
25
 
        @EmbeddedId
26
 
        public LecturePK getId() {
27
 
                return this.id;
28
 
        }
29
 
 
30
 
        public void setId(LecturePK id) {
31
 
                this.id = id;
32
 
        }
33
 
 
34
 
 
35
 
        //bi-directional many-to-one association to Course
36
 
        @ManyToOne
37
 
        @JoinColumn(name="course", nullable=false, insertable=false, updatable=false)
38
 
        public Course getCourseBean() {
39
 
                return this.courseBean;
40
 
        }
41
 
 
42
 
        public void setCourseBean(Course courseBean) {
43
 
                this.courseBean = courseBean;
44
 
        }
45
 
 
46
 
 
47
 
        //bi-directional many-to-one association to StudentAttendance
48
 
        @OneToMany(mappedBy="lecture")
49
 
        public List<StudentAttendance> getStudentAttendances() {
50
 
                return this.studentAttendances;
51
 
        }
52
 
 
53
 
        public void setStudentAttendances(List<StudentAttendance> studentAttendances) {
54
 
                this.studentAttendances = studentAttendances;
55
 
        }
56
 
 
57
 
        public StudentAttendance addStudentAttendance(StudentAttendance studentAttendance) {
58
 
                getStudentAttendances().add(studentAttendance);
59
 
                studentAttendance.setLecture(this);
60
 
 
61
 
                return studentAttendance;
62
 
        }
63
 
 
64
 
        public StudentAttendance removeStudentAttendance(StudentAttendance studentAttendance) {
65
 
                getStudentAttendances().remove(studentAttendance);
66
 
                studentAttendance.setLecture(null);
67
 
 
68
 
                return studentAttendance;
69
 
        }
 
15
  private static final long serialVersionUID = 1L;
 
16
  private LecturePK id;
 
17
  private Course courseBean;
 
18
  private List<StudentAttendance> studentAttendances;
 
19
 
 
20
  public Lecture() {
 
21
  }
 
22
 
 
23
  @EmbeddedId
 
24
  public LecturePK getId() {
 
25
    return this.id;
 
26
  }
 
27
 
 
28
  public void setId(LecturePK id) {
 
29
    this.id = id;
 
30
  }
 
31
 
 
32
  // bi-directional many-to-one association to Course
 
33
  @ManyToOne
 
34
  @JoinColumn(name = "course", nullable = false, insertable = false, updatable = false)
 
35
  public Course getCourseBean() {
 
36
    return this.courseBean;
 
37
  }
 
38
 
 
39
  public void setCourseBean(Course courseBean) {
 
40
    this.courseBean = courseBean;
 
41
  }
 
42
 
 
43
  // bi-directional many-to-one association to StudentAttendance
 
44
  @OneToMany(mappedBy = "lecture")
 
45
  public List<StudentAttendance> getStudentAttendances() {
 
46
    return this.studentAttendances;
 
47
  }
 
48
 
 
49
  public void setStudentAttendances(List<StudentAttendance> studentAttendances) {
 
50
    this.studentAttendances = studentAttendances;
 
51
  }
 
52
 
 
53
  public StudentAttendance addStudentAttendance(StudentAttendance studentAttendance) {
 
54
    getStudentAttendances().add(studentAttendance);
 
55
    studentAttendance.setLecture(this);
 
56
 
 
57
    return studentAttendance;
 
58
  }
 
59
 
 
60
  public StudentAttendance removeStudentAttendance(StudentAttendance studentAttendance) {
 
61
    getStudentAttendances().remove(studentAttendance);
 
62
    studentAttendance.setLecture(null);
 
63
 
 
64
    return studentAttendance;
 
65
  }
70
66
 
71
67
}
 
 
b'\\ No newline at end of file'