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-11-27 16:53:36 +01:00
|
|
|
/**
|
|
|
|
* Course
|
|
|
|
*
|
|
|
|
* @param name name given to the course
|
|
|
|
* @param symbol symbol given to the course
|
|
|
|
*/
|
2020-09-21 17:45:52 +02:00
|
|
|
public Course(String name, String symbol) {
|
|
|
|
this.name = name;
|
|
|
|
this.symbol = symbol;
|
|
|
|
}
|
|
|
|
|
2020-11-27 16:53:36 +01:00
|
|
|
/**
|
|
|
|
* getId
|
|
|
|
* @return id
|
|
|
|
*/
|
2020-08-08 14:14:42 +02:00
|
|
|
public Long getId() {
|
|
|
|
return this.id;
|
|
|
|
}
|
|
|
|
|
2020-11-27 16:53:36 +01:00
|
|
|
/**
|
|
|
|
* getName
|
|
|
|
* @return name
|
|
|
|
*/
|
2020-07-25 10:56:11 +02:00
|
|
|
public String getName() {
|
|
|
|
return name;
|
|
|
|
}
|
|
|
|
|
2020-11-27 16:53:36 +01:00
|
|
|
/**
|
|
|
|
* getSymbol
|
|
|
|
* @return symbol
|
|
|
|
*/
|
2020-07-25 10:56:11 +02:00
|
|
|
public String getSymbol() {
|
|
|
|
return symbol;
|
|
|
|
}
|
|
|
|
|
2020-11-27 16:53:36 +01:00
|
|
|
/**
|
|
|
|
* setSymbol
|
|
|
|
* @param symbol set symbol in the course
|
|
|
|
*/
|
2020-07-25 10:56:11 +02:00
|
|
|
public void setSymbol(String symbol) {
|
|
|
|
this.symbol = symbol;
|
|
|
|
}
|
2020-11-27 16:53:36 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* setName
|
|
|
|
* @param name set name in the course
|
|
|
|
*/
|
2020-07-25 10:56:11 +02:00
|
|
|
public void setName(String name) {
|
|
|
|
this.name = name;
|
|
|
|
}
|
|
|
|
|
2020-11-27 16:53:36 +01:00
|
|
|
/**
|
|
|
|
* getGroups
|
|
|
|
* @return groups return list groups
|
|
|
|
*/
|
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
|
|
|
}
|