Last change
on this file was b3f2adb, checked in by Aleksandar Siljanoski <acewow3@…>, 14 months ago |
Adding project to repo
|
-
Property mode
set to
100644
|
File size:
968 bytes
|
Rev | Line | |
---|
[b3f2adb] | 1 | package com.example.eatys_app.model;
|
---|
| 2 |
|
---|
| 3 |
|
---|
| 4 | import jakarta.persistence.*;
|
---|
| 5 |
|
---|
| 6 | @Entity
|
---|
| 7 | @Table(name = "meni", schema = "project")
|
---|
| 8 | public class Meni {
|
---|
| 9 |
|
---|
| 10 | @Id
|
---|
| 11 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
---|
| 12 | @Column(name = "meni_id", nullable = false)
|
---|
| 13 | private Integer id;
|
---|
| 14 |
|
---|
| 15 | @ManyToOne
|
---|
| 16 | @JoinColumn(name = "restoran_id")
|
---|
| 17 | private Restoran restoran;
|
---|
| 18 |
|
---|
| 19 |
|
---|
| 20 | @OneToOne
|
---|
| 21 | @JoinColumn(name = "tip_id")
|
---|
| 22 | private Tip tip;
|
---|
| 23 |
|
---|
| 24 | public Meni() {
|
---|
| 25 | }
|
---|
| 26 |
|
---|
| 27 | public Meni(Restoran restoran, Tip tip) {
|
---|
| 28 | this.restoran = restoran;
|
---|
| 29 | this.tip = tip;
|
---|
| 30 | }
|
---|
| 31 |
|
---|
| 32 | public Integer getId() {
|
---|
| 33 | return id;
|
---|
| 34 | }
|
---|
| 35 |
|
---|
| 36 | public void setId(Integer id) {
|
---|
| 37 | this.id = id;
|
---|
| 38 | }
|
---|
| 39 |
|
---|
| 40 | public Restoran getRestoran() {
|
---|
| 41 | return restoran;
|
---|
| 42 | }
|
---|
| 43 |
|
---|
| 44 | public void setRestoran(Restoran restoran) {
|
---|
| 45 | this.restoran = restoran;
|
---|
| 46 | }
|
---|
| 47 |
|
---|
| 48 | public Tip getTip() {
|
---|
| 49 | return tip;
|
---|
| 50 | }
|
---|
| 51 |
|
---|
| 52 | public void setTip(Tip tip) {
|
---|
| 53 | this.tip = tip;
|
---|
| 54 | }
|
---|
| 55 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.