64 lines
1.2 KiB
Java
Executable File
64 lines
1.2 KiB
Java
Executable File
package com.magistr.app.model;
|
|
|
|
import jakarta.persistence.*;
|
|
|
|
@Entity
|
|
@Table(name = "subjects")
|
|
public class Subject extends LifecycleEntity {
|
|
|
|
@Id
|
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
private Long id;
|
|
|
|
@Column(unique = true, nullable = false, length = 200)
|
|
private String name;
|
|
|
|
@Column(name = "code")
|
|
private String code;
|
|
|
|
@Column(name = "department_id", nullable = false)
|
|
private Long departmentId;
|
|
|
|
public Subject() {
|
|
}
|
|
|
|
public Subject(Long id, String name, String code, Long departmentId) {
|
|
this.id = id;
|
|
this.name = name;
|
|
this.code = code;
|
|
this.departmentId = departmentId;
|
|
}
|
|
|
|
public Long getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(Long id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public String getName() {
|
|
return name;
|
|
}
|
|
|
|
public void setName(String name) {
|
|
this.name = name;
|
|
}
|
|
|
|
public String getCode() {
|
|
return code;
|
|
}
|
|
|
|
public void setCode(String code) {
|
|
this.code = code;
|
|
}
|
|
|
|
public Long getDepartmentId() {
|
|
return departmentId;
|
|
}
|
|
|
|
public void setDepartmentId(Long departmentId) {
|
|
this.departmentId = departmentId;
|
|
}
|
|
}
|