Checkpint - algorythm works
This commit is contained in:
@ -25,7 +25,6 @@ public class Assignment {
|
||||
@JoinColumn(name = "commision_id")
|
||||
private Commision commision;
|
||||
private boolean isPastAssignment;
|
||||
private boolean isAccepted;
|
||||
|
||||
/**
|
||||
* Assignment
|
||||
@ -37,7 +36,6 @@ public class Assignment {
|
||||
public Assignment(Groups group, Commision commision, boolean isPastAssignment) {
|
||||
this.commision = commision;
|
||||
this.group = group;
|
||||
this.isAccepted = false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -46,16 +44,7 @@ public class Assignment {
|
||||
* @return boolean isAccepted
|
||||
*/
|
||||
public boolean isAccepted() {
|
||||
return isAccepted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set is accepted by algorythm
|
||||
*
|
||||
* @param isAccepted boolean isAccepted
|
||||
*/
|
||||
public void setAccepted(boolean isAccepted) {
|
||||
this.isAccepted = isAccepted;
|
||||
return this.group.getRegisteredStudents().contains(this.commision.getCommisionOwner());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -4,6 +4,7 @@ import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.FetchType;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
@ -40,7 +41,7 @@ public class Groups {
|
||||
private Lecturer lecturer;
|
||||
private Integer zajCykId;
|
||||
private Integer grNr;
|
||||
@ManyToMany(mappedBy = "studentRegisteredGrups")
|
||||
@ManyToMany(mappedBy = "studentRegisteredGrups", fetch = FetchType.EAGER)
|
||||
private Set<User> registeredStudents;
|
||||
|
||||
public Set<User> getRegisteredStudents() {
|
||||
|
@ -8,6 +8,7 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.FetchType;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
@ -38,7 +39,7 @@ public class User {
|
||||
private String refreshToken;
|
||||
private Timestamp tokenUsageDate;
|
||||
private Integer ranking;
|
||||
@ManyToMany(cascade = CascadeType.ALL)
|
||||
@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
|
||||
@JoinTable
|
||||
private Set<Groups> studentRegisteredGrups;
|
||||
|
||||
|
Reference in New Issue
Block a user