source: src/main/java/com/tourMate/entities/RestaurantsTable.java@ e9b4ba9

Last change on this file since e9b4ba9 was e9b4ba9, checked in by darsov2 <62809499+darsov2@…>, 12 months ago

prototype

  • Property mode set to 100644
File size: 1.3 KB
RevLine 
[e9b4ba9]1package com.tourMate.entities;
2
3import com.fasterxml.jackson.annotation.JsonIgnore;
4import jakarta.persistence.*;
5
6import javax.validation.constraints.NotNull;
7
8@Entity
9@Table(name = "restaurant_tables", schema = "public")
10public class RestaurantsTable {
11 private long tableId;
12 @JsonIgnore
13 private Restaurant restaurant;
14 private int noSeats;
15
16 public RestaurantsTable(Restaurant restaurant, int noSeats) {
17 this.restaurant = restaurant;
18 this.noSeats = noSeats;
19 }
20
21 public RestaurantsTable() {
22 }
23
24 @Id
25 @GeneratedValue(strategy = GenerationType.IDENTITY)
26 @Column(name = "table_id",unique = true,nullable = false)
27 public long getTableId() {
28 return tableId;
29 }
30
31 public void setTableId(long tableId) {
32 this.tableId = tableId;
33 }
34
35 @ManyToOne(fetch = FetchType.LAZY)
36 @JoinColumn(name = "restaurant_id", unique = false, nullable = false, foreignKey = @ForeignKey(name = "fk_ref_od_masi_kon_restorani"))
37 public Restaurant getRestaurant() {
38 return restaurant;
39 }
40
41 public void setRestaurant(Restaurant restaurant) {
42 this.restaurant = restaurant;
43 }
44
45 @Column(name="no_seats",unique = false,nullable = false)
46 @NotNull
47 public int getNoSeats() {
48 return noSeats;
49 }
50
51 public void setNoSeats(int noSeats) {
52
53 this.noSeats = noSeats;
54 }
55}
Note: See TracBrowser for help on using the repository browser.