2018-05-04 18:04:09 +04:00
|
|
|
|
package ru.ulstu.paper.model;
|
|
|
|
|
|
2018-05-05 00:24:48 +04:00
|
|
|
|
import org.hibernate.validator.constraints.NotBlank;
|
|
|
|
|
import ru.ulstu.core.model.BaseEntity;
|
2018-05-05 10:57:02 +04:00
|
|
|
|
import ru.ulstu.file.model.FileData;
|
2018-05-05 00:24:48 +04:00
|
|
|
|
|
|
|
|
|
import javax.persistence.*;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
|
|
@Entity
|
|
|
|
|
public class Paper extends BaseEntity {
|
|
|
|
|
public enum PaperStatus {
|
2018-05-05 11:17:13 +04:00
|
|
|
|
DRAFT("Черновик"), ON_PREPARATION("На подготовке"), COMPLETED("Завершена"), ATTENTION("Обратить внимание");
|
2018-05-05 00:24:48 +04:00
|
|
|
|
|
|
|
|
|
private String name;
|
|
|
|
|
|
|
|
|
|
PaperStatus(String name) {
|
|
|
|
|
this.name = name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getName() {
|
|
|
|
|
return name;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@NotBlank
|
2018-05-04 18:04:09 +04:00
|
|
|
|
private String title;
|
|
|
|
|
|
2018-05-05 00:24:48 +04:00
|
|
|
|
@Enumerated(value = EnumType.STRING)
|
|
|
|
|
private PaperStatus status;
|
|
|
|
|
|
|
|
|
|
@Column(name = "create_date")
|
|
|
|
|
private Date createDate;
|
|
|
|
|
|
|
|
|
|
@Column(name = "update_date")
|
|
|
|
|
private Date updateDate;
|
|
|
|
|
|
|
|
|
|
private String comment;
|
|
|
|
|
|
|
|
|
|
private Boolean locked;
|
|
|
|
|
|
|
|
|
|
@ManyToOne
|
2018-05-05 10:57:02 +04:00
|
|
|
|
@JoinColumn(name = "file_id")
|
|
|
|
|
private FileData fileData;
|
2018-05-05 00:24:48 +04:00
|
|
|
|
|
|
|
|
|
public PaperStatus getStatus() {
|
|
|
|
|
return status;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setStatus(PaperStatus status) {
|
|
|
|
|
this.status = status;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Date getCreateDate() {
|
|
|
|
|
return createDate;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setCreateDate(Date createDate) {
|
|
|
|
|
this.createDate = createDate;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Date getUpdateDate() {
|
|
|
|
|
return updateDate;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setUpdateDate(Date updateDate) {
|
|
|
|
|
this.updateDate = updateDate;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getComment() {
|
|
|
|
|
return comment;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setComment(String comment) {
|
|
|
|
|
this.comment = comment;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Boolean getLocked() {
|
|
|
|
|
return locked;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setLocked(Boolean locked) {
|
|
|
|
|
this.locked = locked;
|
2018-05-04 18:04:09 +04:00
|
|
|
|
}
|
|
|
|
|
|
2018-05-05 10:57:02 +04:00
|
|
|
|
public FileData getFileData() {
|
|
|
|
|
return fileData;
|
2018-05-04 18:04:09 +04:00
|
|
|
|
}
|
|
|
|
|
|
2018-05-05 10:57:02 +04:00
|
|
|
|
public void setFileData(FileData fileData) {
|
|
|
|
|
this.fileData = fileData;
|
2018-05-04 18:04:09 +04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getTitle() {
|
|
|
|
|
return title;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setTitle(String title) {
|
|
|
|
|
this.title = title;
|
|
|
|
|
}
|
|
|
|
|
}
|