source: src/main/java/project/educatum/model/Subject.java

Last change on this file was d3cf3a1, checked in by Marija Micevska <marija_micevska@…>, 2 years ago

Initial commit

  • Property mode set to 100644
File size: 722 bytes
Line 
1package project.educatum.model;
2
3import lombok.Data;
4
5import javax.persistence.*;
6
7@Data
8@Entity
9@Table(name = "predmeti", schema = "project")
10public class Subject {
11 @Id
12 @GeneratedValue(strategy = GenerationType.IDENTITY)
13 @Column(name = "id_predmet", nullable = false)
14 private Integer id;
15
16 @Column(name = "ime", nullable = false, length = 100)
17 private String name;
18
19 @ManyToOne(optional = false)
20 @JoinColumn(name = "id_admin", nullable = false)
21 private Admin idAdmin;
22
23 public Subject(String name, Admin idAdmin) {
24 this.name = name;
25 this.idAdmin = idAdmin;
26 }
27
28 public Subject() {
29 }
30
31 @Override
32 public String toString() {
33 return name;
34 }
35
36}
Note: See TracBrowser for help on using the repository browser.