Added flaging assignment. Coumetr froup infor needs to be added

This commit is contained in:
BuildTools
2020-11-14 16:52:22 +01:00
parent 1ddeb83cb4
commit c34ce94fb0
7 changed files with 97 additions and 16 deletions

View File

@ -4,6 +4,7 @@ import java.sql.Timestamp;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@ -21,9 +22,14 @@ public class Commision {
private User commisionOwner;
private Timestamp commisionDate;
@OneToMany(mappedBy = "commision")
@OneToMany(mappedBy = "commision", fetch = FetchType.EAGER)
private List<Assignment> assignments;
/**
*
* @param user owner of commission. Can not be null otherwise saving commision
* will fail.
*/
public Commision(User user) {
this.commisionDate = new Timestamp(System.currentTimeMillis());
this.commisionOwner = user;
@ -44,4 +50,8 @@ public class Commision {
return commisionOwner;
}
public List<Assignment> getAssignments() {
return this.assignments;
}
}