source: src/main/java/com/example/eatys_app/model/SeSostoiOd.java@ b3f2adb

Last change on this file since b3f2adb was b3f2adb, checked in by Aleksandar Siljanoski <acewow3@…>, 14 months ago

Adding project to repo

  • Property mode set to 100644
File size: 2.4 KB
Line 
1package com.example.eatys_app.model;
2
3import jakarta.persistence.*;
4import jakarta.persistence.criteria.CriteriaBuilder;
5
6@Entity
7@Table(name = "se_sostoi_od", schema = "project")
8@IdClass(SeSostoiOdId.class)
9public class SeSostoiOd {
10
11// @EmbeddedId
12// @AttributeOverrides({ @AttributeOverride(name = "naracka_id", column = @Column(name =
13// "naracka_id", nullable = false)),
14// @AttributeOverride(name = "obrok_id", column = @Column(name = "obrok_id", nullable = false)) })
15// SeSostoiOdId id;
16
17
18 @Id
19 @ManyToOne
20 @JoinColumn(name = "naracka_id", nullable = false)
21 private Naracka naracka;
22
23
24 @Id
25 @ManyToOne
26 @JoinColumn(name = "obrok_id", nullable = false)
27 private Obrok obrok;
28
29 @Column(name = "kolicina", nullable = false)
30 private Integer kolicina;
31
32 @Column(name = "cena", nullable = false)
33 private Integer cena;
34
35 public SeSostoiOd() {
36 }
37
38 public SeSostoiOd(Naracka naracka, Obrok obrok, Integer kolicina, Integer cena) {
39 this.naracka = naracka;
40 this.obrok = obrok;
41 this.kolicina = kolicina;
42 this.cena = cena;
43 }
44
45 public SeSostoiOd(SeSostoiOdId id, Naracka naracka, Obrok obrok, Integer kolicina, Integer cena) {
46// this.id = id;
47 this.naracka = naracka;
48 this.obrok = obrok;
49 this.kolicina = kolicina;
50 this.cena = cena;
51 }
52
53// public SeSostoiOdId getId() {
54// return id;
55// }
56//
57// public void setId(SeSostoiOdId id) {
58// this.id = id;
59// }
60
61 public Naracka getNaracka() {
62 return naracka;
63 }
64
65 public void setNaracka(Naracka naracka) {
66 this.naracka = naracka;
67 }
68
69 public Obrok getObrok() {
70 return obrok;
71 }
72
73 public void setObrok(Obrok obrok) {
74 this.obrok = obrok;
75 }
76
77 public Integer getKolicina() {
78 return kolicina;
79 }
80
81 public void setKolicina(Integer kolicina) {
82 this.kolicina = kolicina;
83 }
84
85 public Integer getCena() {
86 return cena;
87 }
88
89 public void setCena(Integer cena) {
90 this.cena = cena;
91 }
92
93// public Integer getNarackaId() {
94// return narackaId;
95// }
96//
97// public void setNarackaId(Integer narackaId) {
98// this.narackaId = narackaId;
99// }
100//
101// public Integer getObrokId() {
102// return obrokId;
103// }
104//
105// public void setObrokId(Integer obrokId) {
106// this.obrokId = obrokId;
107// }
108}
Note: See TracBrowser for help on using the repository browser.