90 lines
1.7 KiB
Java
Executable File
90 lines
1.7 KiB
Java
Executable File
package com.plannaplan.entities;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
import javax.persistence.Entity;
|
|
import javax.persistence.FetchType;
|
|
import javax.persistence.GeneratedValue;
|
|
import javax.persistence.GenerationType;
|
|
import javax.persistence.Id;
|
|
import javax.persistence.OneToMany;
|
|
|
|
/**
|
|
* Entity of Course grouping of state of course
|
|
*/
|
|
|
|
@Entity
|
|
public class Course {
|
|
@Id
|
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
|
private Long id;
|
|
private String name;
|
|
private String symbol;
|
|
@OneToMany(mappedBy = "course", fetch = FetchType.EAGER)
|
|
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
|
|
*/
|
|
public Long getId() {
|
|
return this.id;
|
|
}
|
|
|
|
/**
|
|
* getName
|
|
* @return name
|
|
*/
|
|
public String getName() {
|
|
return name;
|
|
}
|
|
|
|
/**
|
|
* getSymbol
|
|
* @return symbol
|
|
*/
|
|
public String getSymbol() {
|
|
return symbol;
|
|
}
|
|
|
|
/**
|
|
* setSymbol
|
|
* @param symbol set symbol in the course
|
|
*/
|
|
public void setSymbol(String symbol) {
|
|
this.symbol = symbol;
|
|
}
|
|
|
|
/**
|
|
* setName
|
|
* @param name set name in the course
|
|
*/
|
|
public void setName(String name) {
|
|
this.name = name;
|
|
}
|
|
|
|
/**
|
|
* getGroups
|
|
* @return groups return list groups
|
|
*/
|
|
public List<Groups> getGroups() {
|
|
return this.groups;
|
|
}
|
|
|
|
}
|