2020-07-23 17:27:20 +02:00
|
|
|
package com.plannaplan.entities;
|
|
|
|
|
|
|
|
import javax.persistence.Entity;
|
|
|
|
import javax.persistence.GeneratedValue;
|
|
|
|
import javax.persistence.GenerationType;
|
|
|
|
import javax.persistence.Id;
|
2020-07-25 10:21:42 +02:00
|
|
|
import javax.persistence.JoinColumn;
|
|
|
|
import javax.persistence.ManyToOne;
|
2020-07-23 17:27:20 +02:00
|
|
|
|
2020-07-25 09:58:40 +02:00
|
|
|
import com.plannaplan.types.GroupType;
|
|
|
|
import com.plannaplan.types.WeekDay;
|
|
|
|
|
2020-07-23 17:27:20 +02:00
|
|
|
@Entity
|
|
|
|
public class Groups {
|
|
|
|
@Id
|
|
|
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
|
|
|
private Long id;
|
2020-07-25 10:56:11 +02:00
|
|
|
@ManyToOne
|
|
|
|
@JoinColumn(name = "course_id")
|
|
|
|
private Course courseId;
|
2020-07-23 17:27:20 +02:00
|
|
|
private int time;
|
|
|
|
private String room;
|
|
|
|
private int capacity;
|
2020-07-25 09:58:40 +02:00
|
|
|
private GroupType type;
|
|
|
|
private WeekDay day;
|
2020-07-25 10:21:42 +02:00
|
|
|
@ManyToOne
|
|
|
|
@JoinColumn(name = "lecturer_id")
|
|
|
|
private Lecturer lecturer;
|
2020-07-23 17:27:20 +02:00
|
|
|
|
|
|
|
public Groups() {
|
|
|
|
}
|
|
|
|
|
2020-08-11 17:36:58 +02:00
|
|
|
public Long getId() {
|
|
|
|
return this.id;
|
|
|
|
}
|
|
|
|
|
2020-07-25 10:21:42 +02:00
|
|
|
public Lecturer getLecturer() {
|
|
|
|
return lecturer;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setLecturer(Lecturer lecturer) {
|
|
|
|
this.lecturer = lecturer;
|
|
|
|
}
|
|
|
|
|
2020-07-25 09:58:40 +02:00
|
|
|
public WeekDay getDay() {
|
|
|
|
return day;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setDay(WeekDay day) {
|
|
|
|
this.day = day;
|
|
|
|
}
|
|
|
|
|
|
|
|
public GroupType getType() {
|
|
|
|
return type;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setType(GroupType type) {
|
|
|
|
this.type = type;
|
|
|
|
}
|
|
|
|
|
2020-07-23 17:27:20 +02:00
|
|
|
public int getCapacity() {
|
|
|
|
return capacity;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setCapacity(int capacity) {
|
|
|
|
this.capacity = capacity;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getRoom() {
|
|
|
|
return room;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setRoom(String room) {
|
|
|
|
this.room = room;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getTime() {
|
|
|
|
return time;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setTime(int time) {
|
|
|
|
this.time = time;
|
|
|
|
}
|
|
|
|
|
2020-07-25 10:56:11 +02:00
|
|
|
public Course getCourseId() {
|
2020-07-23 17:27:20 +02:00
|
|
|
return courseId;
|
|
|
|
}
|
|
|
|
|
2020-07-25 10:56:11 +02:00
|
|
|
public void setCourseId(Course courseId) {
|
2020-07-23 17:27:20 +02:00
|
|
|
this.courseId = courseId;
|
|
|
|
}
|
2020-08-18 15:41:03 +02:00
|
|
|
|
|
|
|
public String getTimeString() {
|
|
|
|
int minutes = this.getTime() % 60;
|
|
|
|
String minutesString = Integer.toString(minutes);
|
|
|
|
if (minutes < 10) {
|
|
|
|
minutesString = "0" + minutesString;
|
|
|
|
}
|
|
|
|
return String.format("%o.%s", this.getTime() / 60, minutesString);
|
|
|
|
}
|
2020-07-23 17:27:20 +02:00
|
|
|
}
|