|
| 1 | +package org.cms.core.files.assignment; |
| 2 | + |
| 3 | +import java.io.Serializable; |
| 4 | +import javax.persistence.*; |
| 5 | +import org.cms.core.course.Course; |
| 6 | +import org.cms.core.instructor.Instructor; |
| 7 | +import org.hibernate.annotations.GenericGenerator; |
| 8 | + |
| 9 | +@Entity |
| 10 | +@Table(name = "assignment") |
| 11 | +public class Assignment implements Serializable { |
| 12 | + |
| 13 | + @OneToOne |
| 14 | + private Instructor instructor; |
| 15 | + |
| 16 | + private String downloadPath; |
| 17 | + |
| 18 | + @OneToOne |
| 19 | + private Course course; |
| 20 | + |
| 21 | + private String uploadDate; |
| 22 | + private String dueDate; |
| 23 | + |
| 24 | + @Id |
| 25 | + @GenericGenerator(name = "assignment_id_generator", strategy = "org.cms.core.files.assignment.AssignmentIdGenerator") |
| 26 | + @GeneratedValue(generator = "assignment_id_generator") |
| 27 | + private String id; |
| 28 | + |
| 29 | + public Assignment() {} |
| 30 | + |
| 31 | + public Assignment(Instructor instructor, String downloadPath, Course course) { |
| 32 | + this.instructor = instructor; |
| 33 | + this.downloadPath = downloadPath; |
| 34 | + this.course = course; |
| 35 | + } |
| 36 | + |
| 37 | + public Instructor getInstructor() { |
| 38 | + return instructor; |
| 39 | + } |
| 40 | + |
| 41 | + public void setInstructor(Instructor instructor) { |
| 42 | + this.instructor = instructor; |
| 43 | + } |
| 44 | + |
| 45 | + public String getDownloadPath() { |
| 46 | + return downloadPath; |
| 47 | + } |
| 48 | + |
| 49 | + public void setDownloadPath(String downloadPath) { |
| 50 | + this.downloadPath = downloadPath; |
| 51 | + } |
| 52 | + |
| 53 | + public Course getCourse() { |
| 54 | + return course; |
| 55 | + } |
| 56 | + |
| 57 | + public void setCourse(Course course) { |
| 58 | + this.course = course; |
| 59 | + } |
| 60 | + |
| 61 | + public String getUploadDate() { |
| 62 | + return uploadDate; |
| 63 | + } |
| 64 | + |
| 65 | + public void setUploadDate(String uploadDate) { |
| 66 | + this.uploadDate = uploadDate; |
| 67 | + } |
| 68 | + |
| 69 | + public String getDueDate() { |
| 70 | + return dueDate; |
| 71 | + } |
| 72 | + |
| 73 | + public void setDueDate(String dueDate) { |
| 74 | + this.dueDate = dueDate; |
| 75 | + } |
| 76 | + |
| 77 | + public String getId() { |
| 78 | + return id; |
| 79 | + } |
| 80 | + |
| 81 | + public void setId(String id) { |
| 82 | + this.id = id; |
| 83 | + } |
| 84 | +} |
0 commit comments