-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathRestaurant.java
More file actions
92 lines (72 loc) · 1.95 KB
/
Restaurant.java
File metadata and controls
92 lines (72 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
package org.example.entities;
import jakarta.persistence.*;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
@Entity
public class Restaurant {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@OneToMany
@JoinColumn(name = "openingHoursId")
private List<OpeningHours> openingHours = new ArrayList<>();
private String name;
private String category;
private String address;
private BigDecimal priceRange;
private double rating;
public Restaurant(Long id, String name, String category, String address, BigDecimal priceRange, double rating) {
this.id = id;
this.name = name;
this.category = category;
this.address = address;
this.priceRange = priceRange;
this.rating = rating;
}
public Restaurant(){}
public Long getId() {
return id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public BigDecimal getPriceRange() {
return priceRange;
}
public void setPriceRange(BigDecimal price_range) {
this.priceRange = price_range;
}
public double getRating() {
return rating;
}
public void setRating(double rating) {
this.rating = rating;
}
@Override
public String toString() {
return "Restaurant{" +
"id=" + id +
", name='" + name + '\'' +
", category='" + category + '\'' +
", address='" + address + '\'' +
", priceRange=" + priceRange +
", rating=" + rating +
'}';
}
}