1 | package com.example.baza.model;
|
---|
2 |
|
---|
3 | import lombok.NoArgsConstructor;
|
---|
4 |
|
---|
5 | import javax.persistence.*;
|
---|
6 |
|
---|
7 | @Entity
|
---|
8 | @Table(name = "ocena", schema = "project")
|
---|
9 | @NoArgsConstructor
|
---|
10 | public class Ocena {
|
---|
11 | @Id
|
---|
12 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
---|
13 | @Column(name = "id_na_ocena", nullable = false)
|
---|
14 | private Integer id;
|
---|
15 |
|
---|
16 | @Column(name = "ocena", nullable = false)
|
---|
17 | private Integer ocena;
|
---|
18 |
|
---|
19 | @Column(name = "komentar", nullable = false, length = 500)
|
---|
20 | private String komentar;
|
---|
21 |
|
---|
22 | @ManyToOne(fetch = FetchType.LAZY, optional = false)
|
---|
23 | @JoinColumn(name = "id_chovek_dava", nullable = false)
|
---|
24 | private Chlen2 chlen;
|
---|
25 |
|
---|
26 | @ManyToOne(fetch = FetchType.LAZY)
|
---|
27 | @JoinColumn(name = "ocena_id_kniga")
|
---|
28 | private Knigi knigi;
|
---|
29 |
|
---|
30 | @ManyToOne(fetch = FetchType.LAZY)
|
---|
31 | @JoinColumn(name = "ocena_id_avtor")
|
---|
32 | private Avtor avtor;
|
---|
33 |
|
---|
34 | public Avtor getAvtor() {
|
---|
35 | return avtor;
|
---|
36 | }
|
---|
37 |
|
---|
38 | public void setAvtor(Avtor avtor) {
|
---|
39 | this.avtor = avtor;
|
---|
40 | }
|
---|
41 |
|
---|
42 | public Knigi getKnigi() {
|
---|
43 | return knigi;
|
---|
44 | }
|
---|
45 |
|
---|
46 | public void setKnigi(Knigi knigi) {
|
---|
47 | this.knigi = knigi;
|
---|
48 | }
|
---|
49 |
|
---|
50 | public Chlen2 getChlen() {
|
---|
51 | return chlen;
|
---|
52 | }
|
---|
53 |
|
---|
54 | public void setChlen(Chlen2 chlen) {
|
---|
55 | this.chlen = chlen;
|
---|
56 | }
|
---|
57 |
|
---|
58 | public String getKomentar() {
|
---|
59 | return komentar;
|
---|
60 | }
|
---|
61 |
|
---|
62 | public void setKomentar(String komentar) {
|
---|
63 | this.komentar = komentar;
|
---|
64 | }
|
---|
65 |
|
---|
66 | public Integer getOcena() {
|
---|
67 | return ocena;
|
---|
68 | }
|
---|
69 |
|
---|
70 | public void setOcena(Integer ocena) {
|
---|
71 | this.ocena = ocena;
|
---|
72 | }
|
---|
73 |
|
---|
74 | public Integer getId() {
|
---|
75 | return id;
|
---|
76 | }
|
---|
77 |
|
---|
78 | public void setId(Integer id) {
|
---|
79 | this.id = id;
|
---|
80 | }
|
---|
81 |
|
---|
82 | public Ocena(Integer ocena, String komentar, Chlen2 chlen, Knigi knigi, Avtor avtor) {
|
---|
83 | this.ocena = ocena;
|
---|
84 | this.komentar = komentar;
|
---|
85 | this.chlen = chlen;
|
---|
86 | this.knigi = knigi;
|
---|
87 | this.avtor = avtor;
|
---|
88 | }
|
---|
89 | } |
---|