132 lines
2.8 KiB
Java

package ru.ulstu.aspirant.model;
import jakarta.persistence.Entity;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Temporal;
import jakarta.persistence.TemporalType;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import ru.ulstu.admin.model.AspirantForm;
import ru.ulstu.indicator.model.Course;
import ru.ulstu.manager.model.Manager;
import ru.ulstu.model.BaseEntity;
import java.util.Date;
@Entity
public class Aspirant extends BaseEntity {
@NotEmpty
private String surname;
@NotEmpty
private String name;
private String patronymic;
@NotNull
private Course course;
@ManyToOne
private Manager manager;
@Temporal(TemporalType.DATE)
private Date birthDate;
@Enumerated(EnumType.STRING)
private Speciality speciality;
private String theme;
@Enumerated(EnumType.STRING)
private Base base;
public Aspirant(AspirantForm aspirantForm) {
this.name = aspirantForm.getName();
this.surname = aspirantForm.getSurname();
this.patronymic = aspirantForm.getPatronymic();
this.theme = aspirantForm.getTheme();
this.manager = aspirantForm.getManager();
this.speciality = aspirantForm.getSpeciality();
this.base = aspirantForm.getBase();
this.birthDate = aspirantForm.getBirthDate();
}
public Aspirant() {
}
public String getSurname() {
return surname;
}
public void setSurname(String surname) {
this.surname = surname;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPatronymic() {
return patronymic;
}
public void setPatronymic(String patronymic) {
this.patronymic = patronymic;
}
public Course getCourse() {
return course;
}
public void setCourse(Course course) {
this.course = course;
}
public Manager getManager() {
return manager;
}
public void setManager(Manager manager) {
this.manager = manager;
}
public Date getBirthDate() {
return birthDate;
}
public void setBirthDate(Date birthDate) {
this.birthDate = birthDate;
}
public Speciality getSpeciality() {
return speciality;
}
public void setSpeciality(Speciality speciality) {
this.speciality = speciality;
}
public String getTheme() {
return theme;
}
public void setTheme(String theme) {
this.theme = theme;
}
public Base getBase() {
return base;
}
public void setBase(Base base) {
this.base = base;
}
}