Resolved confilics with master
Signed-off-by: Marcin Woźniak <y0rune@aol.com>
This commit is contained in:
@ -23,26 +23,34 @@ public class Assignment {
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "commision_id")
|
||||
private Commision commision;
|
||||
|
||||
private boolean isPastAssignment;
|
||||
|
||||
/**
|
||||
* Assignment
|
||||
*
|
||||
* @param group group you would like to assign
|
||||
* @param commision commision assignment belongs to group
|
||||
*
|
||||
* Assignment
|
||||
* @param group group we would like to assign
|
||||
* @param commision commision that assignment belongs to
|
||||
* @param isPastAssignment is assignment past or no
|
||||
*/
|
||||
public Assignment(Groups group, Commision commision) {
|
||||
public Assignment(Groups group, Commision commision, boolean isPastAssignment) {
|
||||
this.commision = commision;
|
||||
this.group = group;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assignment
|
||||
* @param group group we would like to assign
|
||||
* @param commision commision that assignment belongs to
|
||||
*/
|
||||
public Assignment(Groups group, Commision commision) {
|
||||
this(group, commision, false);
|
||||
}
|
||||
|
||||
public Assignment() {
|
||||
}
|
||||
|
||||
/**
|
||||
* getId
|
||||
*
|
||||
* @return id
|
||||
* Id getter
|
||||
* @return id id of assignment
|
||||
*/
|
||||
|
||||
public Long getId() {
|
||||
@ -57,4 +65,20 @@ public class Assignment {
|
||||
public Groups getGroup() {
|
||||
return this.group;
|
||||
}
|
||||
|
||||
/**
|
||||
* isPastAssignment getter
|
||||
* @return isPastAssignment
|
||||
*/
|
||||
public boolean isPastAssignment() {
|
||||
return isPastAssignment;
|
||||
}
|
||||
|
||||
/**
|
||||
* setter isPastAssignment
|
||||
* @param isPastAssignment
|
||||
*/
|
||||
public void setPastAssignment(boolean isPastAssignment) {
|
||||
this.isPastAssignment = isPastAssignment;
|
||||
}
|
||||
}
|
@ -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;
|
||||
@ -25,13 +26,13 @@ public class Commision {
|
||||
private User commisionOwner;
|
||||
private Timestamp commisionDate;
|
||||
|
||||
@OneToMany(mappedBy = "commision")
|
||||
@OneToMany(mappedBy = "commision", fetch = FetchType.EAGER)
|
||||
private List<Assignment> assignments;
|
||||
|
||||
/**
|
||||
* Commision
|
||||
*
|
||||
* @param user user assign to the group
|
||||
*
|
||||
* @param user owner of commission. Can not be null otherwise saving commision
|
||||
* will fail.
|
||||
*/
|
||||
public Commision(User user) {
|
||||
this.commisionDate = new Timestamp(System.currentTimeMillis());
|
||||
@ -42,30 +43,35 @@ public class Commision {
|
||||
}
|
||||
|
||||
/**
|
||||
* getId
|
||||
*
|
||||
* @return id
|
||||
* Id getter
|
||||
* @return id id of commision
|
||||
*/
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
/**
|
||||
* getCommisionDate
|
||||
*
|
||||
* @return commisionDate
|
||||
* CommisionDate getter
|
||||
* @return commisionDate
|
||||
*/
|
||||
public Timestamp getCommisionDate() {
|
||||
return commisionDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* getCommisionOwner
|
||||
*
|
||||
* @return commisionOwner
|
||||
* User of given commision getter
|
||||
* @return User commisionOwner
|
||||
*/
|
||||
public User getCommisionOwner() {
|
||||
return commisionOwner;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assigments getter
|
||||
* @return List of assignments
|
||||
*/
|
||||
public List<Assignment> getAssignments() {
|
||||
return this.assignments;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user