Add aspirant model

This commit is contained in:
Anton Romanov 2025-01-29 14:13:34 +04:00
parent 10f65e11a2
commit 6ad4ea0083
2 changed files with 231 additions and 0 deletions

View File

@ -0,0 +1,110 @@
package ru.ulstu.admin.model;
import ru.ulstu.aspirant.model.Base;
import ru.ulstu.aspirant.model.Speciality;
import ru.ulstu.indicator.model.Course;
import ru.ulstu.manager.model.Manager;
import java.util.Date;
public class AspirantForm {
private Integer id;
private String surname;
private String name;
private String patronymic;
private Course course;
private Manager manager;
private Date birthDate;
private Speciality speciality;
private String theme;
private Base base;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
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;
}
}

View File

@ -0,0 +1,121 @@
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();
}
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;
}
}