Added enpoint /getCoursesWithGroups
This commit is contained in:
@ -4,6 +4,7 @@ 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;
|
||||
@ -16,7 +17,7 @@ public class Course {
|
||||
private Long id;
|
||||
private String name;
|
||||
private String symbol;
|
||||
@OneToMany(mappedBy = "id")
|
||||
@OneToMany(mappedBy = "courseId", fetch = FetchType.EAGER)
|
||||
private List<Groups> groups = new ArrayList<>();
|
||||
|
||||
public Course() {
|
||||
@ -42,4 +43,8 @@ public class Course {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public List<Groups> getGroups(){
|
||||
return this.groups;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user