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;
|
|
|
|
|
2020-11-18 09:01:45 +01:00
|
|
|
/**
|
|
|
|
* 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;
|
2020-09-21 17:45:52 +02:00
|
|
|
@OneToMany(mappedBy = "course", fetch = FetchType.EAGER)
|
2020-07-25 10:56:11 +02:00
|
|
|
private List<Groups> groups = new ArrayList<>();
|
|
|
|
|
|
|
|
public Course() {
|
|
|
|
}
|
|
|
|
|
2020-09-21 17:45:52 +02:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2020-09-21 17:45:52 +02:00
|
|
|
public List<Groups> getGroups() {
|
2020-08-24 12:02:44 +02:00
|
|
|
return this.groups;
|
|
|
|
}
|
|
|
|
|
2020-09-21 17:45:52 +02:00
|
|
|
}
|