main
Last change
on this file since 9bf1f8d was 9bf1f8d, checked in by viktor <viktor@…>, 17 months ago |
prefinal
|
-
Property mode
set to
100644
|
File size:
860 bytes
|
Line | |
---|
1 | package mk.profesori.springapp.Model;
|
---|
2 |
|
---|
3 | import com.fasterxml.jackson.annotation.JsonIdentityInfo;
|
---|
4 | import com.voodoodyne.jackson.jsog.JSOGGenerator;
|
---|
5 | import lombok.Data;
|
---|
6 |
|
---|
7 | import javax.persistence.*;
|
---|
8 | import java.util.HashSet;
|
---|
9 | import java.util.Set;
|
---|
10 |
|
---|
11 | @Entity
|
---|
12 | @Data
|
---|
13 | @Table(name = "faculty")
|
---|
14 | @JsonIdentityInfo(generator = JSOGGenerator.class)
|
---|
15 | public class Faculty {
|
---|
16 |
|
---|
17 | @Id
|
---|
18 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
---|
19 | @Column(name = "id")
|
---|
20 | private Long facultyId;
|
---|
21 |
|
---|
22 | @Column(name = "name")
|
---|
23 | private String facultyName;
|
---|
24 |
|
---|
25 | @ManyToOne
|
---|
26 | @JoinColumn(name = "university_id")
|
---|
27 | private University university;
|
---|
28 |
|
---|
29 | @Transient
|
---|
30 | @OneToMany(mappedBy = "faculty")
|
---|
31 | private Set<Professor> professors = new HashSet<>();
|
---|
32 |
|
---|
33 | @Transient
|
---|
34 | @OneToMany(mappedBy = "faculty")
|
---|
35 | private Set<StudyProgramme> studyProgrammes = new HashSet<>();
|
---|
36 |
|
---|
37 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.