source: src/main/java/com/example/baza/model/InstancaOdKniga.java

Last change on this file was ed20c2c, checked in by HumaSejdini <humasejdini12@…>, 2 years ago

Initial commit

  • Property mode set to 100644
File size: 2.1 KB
Line 
1package com.example.baza.model;
2
3import lombok.NoArgsConstructor;
4
5import javax.persistence.*;
6
7@Entity
8@Table(name = "instanca_od_kniga", schema = "project")
9@NoArgsConstructor
10public class InstancaOdKniga {
11 @EmbeddedId
12 private InstancaOdKnigaId id;
13
14 @MapsId("idNaKniga")
15 @ManyToOne(fetch = FetchType.LAZY, optional = false)
16 @JoinColumn(name = "id_na_kniga", nullable = false)
17 private Knigi idNaKniga;
18
19 @Column(name = "dali_e_ostetena", nullable = false)
20 private Boolean daliEOstetena = false;
21
22 @Column(name = "status", nullable = false)
23 private Boolean status = false;
24
25 @ManyToOne(fetch = FetchType.LAZY, optional = false)
26 @JoinColumn(name = "id_na_dobavuvac", nullable = false)
27 private Dobavuvac idNaDobavuvac;
28
29 public InstancaOdKniga(Knigi idNaKniga, Boolean daliEOstetena, Boolean status, Dobavuvac idNaDobavuvac) {
30 this.idNaKniga = idNaKniga;
31 this.daliEOstetena = daliEOstetena;
32 this.status = status;
33 this.idNaDobavuvac = idNaDobavuvac;
34 }
35
36 public InstancaOdKniga(InstancaOdKnigaId id, Knigi idNaKniga, Boolean daliEOstetena, Boolean status, Dobavuvac idNaDobavuvac) {
37 this.id = id;
38 this.idNaKniga = idNaKniga;
39 this.daliEOstetena = daliEOstetena;
40 this.status = status;
41 this.idNaDobavuvac = idNaDobavuvac;
42 }
43
44 public Dobavuvac getIdNaDobavuvac() {
45 return idNaDobavuvac;
46 }
47
48 public void setIdNaDobavuvac(Dobavuvac idNaDobavuvac) {
49 this.idNaDobavuvac = idNaDobavuvac;
50 }
51
52 public Boolean getStatus() {
53 return status;
54 }
55
56 public void setStatus(Boolean status) {
57 this.status = status;
58 }
59
60 public Boolean getDaliEOstetena() {
61 return daliEOstetena;
62 }
63
64 public void setDaliEOstetena(Boolean daliEOstetena) {
65 this.daliEOstetena = daliEOstetena;
66 }
67
68 public Knigi getIdNaKniga() {
69 return idNaKniga;
70 }
71
72 public void setIdNaKniga(Knigi idNaKniga) {
73 this.idNaKniga = idNaKniga;
74 }
75
76 public InstancaOdKnigaId getId() {
77 return id;
78 }
79
80 public void setId(InstancaOdKnigaId id) {
81 this.id = id;
82 }
83}
Note: See TracBrowser for help on using the repository browser.