99 lines
2.3 KiB
Java
99 lines
2.3 KiB
Java
|
package ru.ulstu.grant.model;
|
|||
|
|
|||
|
import org.hibernate.validator.constraints.NotBlank;
|
|||
|
import ru.ulstu.core.model.BaseEntity;
|
|||
|
import ru.ulstu.core.model.UserContainer;
|
|||
|
import ru.ulstu.file.model.FileData;
|
|||
|
import ru.ulstu.user.model.User;
|
|||
|
|
|||
|
import javax.persistence.*;
|
|||
|
import javax.validation.constraints.NotNull;
|
|||
|
import java.util.Date;
|
|||
|
import java.util.HashSet;
|
|||
|
import java.util.Set;
|
|||
|
|
|||
|
@Entity
|
|||
|
public class Grant extends BaseEntity {
|
|||
|
public enum GrantStatus {
|
|||
|
APPLICATION("Заявка"),
|
|||
|
ON_COMPETITION("Отправлен на конкурс"),
|
|||
|
SUCCESSFUL_PASSAGE("Успешное прохождение"),
|
|||
|
IN_WORK("В работе"),
|
|||
|
COMPLETED("Завершен"),
|
|||
|
FAILED("Провалены сроки");
|
|||
|
|
|||
|
private String name;
|
|||
|
|
|||
|
GrantStatus(String name) {
|
|||
|
this.name = name;
|
|||
|
}
|
|||
|
|
|||
|
public String getName() {
|
|||
|
return name;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
@NotBlank
|
|||
|
private String title;
|
|||
|
|
|||
|
@Enumerated(value = EnumType.STRING)
|
|||
|
private GrantStatus status = GrantStatus.APPLICATION;
|
|||
|
|
|||
|
@Column(name = "deadline_date")
|
|||
|
@NotNull
|
|||
|
private Date deadlineDate;
|
|||
|
|
|||
|
//Описание гранта
|
|||
|
@NotNull
|
|||
|
private String comment;
|
|||
|
|
|||
|
//Заявка на грант
|
|||
|
@NotNull
|
|||
|
private FileData application;
|
|||
|
|
|||
|
@OneToOne
|
|||
|
@JoinColumn(name = "project_id")
|
|||
|
private Integer projectId;
|
|||
|
|
|||
|
public GrantStatus getStatus() {
|
|||
|
return status;
|
|||
|
}
|
|||
|
|
|||
|
public void setStatus(GrantStatus status) {
|
|||
|
this.status = status;
|
|||
|
}
|
|||
|
|
|||
|
public Date getDeadlineDate() {
|
|||
|
return deadlineDate;
|
|||
|
}
|
|||
|
|
|||
|
public void setDeadlineDate(Date deadlineDate) {
|
|||
|
this.deadlineDate = deadlineDate;
|
|||
|
}
|
|||
|
|
|||
|
public String getComment() {
|
|||
|
return comment;
|
|||
|
}
|
|||
|
|
|||
|
public void setComment(String comment) {
|
|||
|
this.comment = comment;
|
|||
|
}
|
|||
|
|
|||
|
public FileData getApplication() {
|
|||
|
return application;
|
|||
|
}
|
|||
|
|
|||
|
public void setApplication(FileData application) { this.application = application; }
|
|||
|
|
|||
|
public String getTitle() {
|
|||
|
return title;
|
|||
|
}
|
|||
|
|
|||
|
public void setTitle(String title) { this.title = title; }
|
|||
|
|
|||
|
public Integer getProjectId() { return projectId;}
|
|||
|
|
|||
|
public void setProjectId(Integer project_id) { this.projectId = projectId; }
|
|||
|
|
|||
|
}
|