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

90 lines
1.7 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() {
}
/**
* Course
*
* @param name name given to the course
* @param symbol symbol given to the course
*/
public Course(String name, String symbol) {
this.name = name;
this.symbol = symbol;
}
/**
* getId
* @return id
*/
2020-08-08 14:14:42 +02:00
public Long getId() {
return this.id;
}
/**
* getName
* @return name
*/
2020-07-25 10:56:11 +02:00
public String getName() {
return name;
}
/**
* getSymbol
* @return symbol
*/
2020-07-25 10:56:11 +02:00
public String getSymbol() {
return symbol;
}
/**
* setSymbol
* @param symbol set symbol in the course
*/
2020-07-25 10:56:11 +02:00
public void setSymbol(String symbol) {
this.symbol = symbol;
}
/**
* setName
* @param name set name in the course
*/
2020-07-25 10:56:11 +02:00
public void setName(String name) {
this.name = name;
}
/**
* getGroups
* @return groups return list groups
*/
public List<Groups> getGroups() {
2020-08-24 12:02:44 +02:00
return this.groups;
}
}