Added enums

This commit is contained in:
Filip Izydorczyk 2020-07-25 09:58:40 +02:00
parent c96d6d8380
commit 8b5d73a5dd
4 changed files with 38 additions and 1 deletions

View File

@ -5,6 +5,9 @@ import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType; import javax.persistence.GenerationType;
import javax.persistence.Id; import javax.persistence.Id;
import com.plannaplan.types.GroupType;
import com.plannaplan.types.WeekDay;
@Entity @Entity
public class Groups { public class Groups {
@Id @Id
@ -14,10 +17,28 @@ public class Groups {
private int time; private int time;
private String room; private String room;
private int capacity; private int capacity;
private GroupType type;
private WeekDay day;
public Groups() { public Groups() {
} }
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;
}
public int getCapacity() { public int getCapacity() {
return capacity; return capacity;
} }

View File

@ -0,0 +1,5 @@
package com.plannaplan.types;
public enum GroupType {
LECTURE, CLASS
}

View File

@ -0,0 +1,11 @@
package com.plannaplan.types;
public enum WeekDay {
MONDAY(1), TUESDAY(2), WEDNESDAY(3), THURSDAY(4), FRIDAY(5), SATURDAY(6), SUNDAY(7);
public final int label;
private WeekDay(int label) {
this.label = label;
}
}

View File

@ -1,5 +1,5 @@
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
spring.datasource.url=jdbc:mysql://172.20.0.3:3306/test?useUnicode=yes&characterEncoding=UTF-8 spring.datasource.url=jdbc:mysql://172.20.0.2:3306/test?useUnicode=yes&characterEncoding=UTF-8
spring.datasource.username=root spring.datasource.username=root
spring.datasource.password=example spring.datasource.password=example
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver