backend/buisnesslogic/src/main/java/com/plannaplan/entities/Course.java

60 lines
1.2 KiB
Java
Raw Normal View History

2020-07-25 10:56:11 +02:00
package com.plannaplan.entities;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Entity;
2020-08-24 12:02:44 +02:00
import javax.persistence.FetchType;
2020-07-25 10:56:11 +02:00
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
/**
* Entity of Course grouping of state of course
*/
2020-07-25 10:56:11 +02:00
@Entity
public class Course {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String name;
private String symbol;
@OneToMany(mappedBy = "course", fetch = FetchType.EAGER)
2020-07-25 10:56:11 +02:00
private List<Groups> groups = new ArrayList<>();
public Course() {
}
public Course(String name, String symbol) {
this.name = name;
this.symbol = symbol;
}
2020-08-08 14:14:42 +02:00
public Long getId() {
return this.id;
}
2020-07-25 10:56:11 +02:00
public String getName() {
return name;
}
public String getSymbol() {
return symbol;
}
public void setSymbol(String symbol) {
this.symbol = symbol;
}
public void setName(String name) {
this.name = name;
}
public List<Groups> getGroups() {
2020-08-24 12:02:44 +02:00
return this.groups;
}
}