-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Restaurant.java
54 lines (40 loc) · 911 Bytes
/
Restaurant.java
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
package net.chrisrichardson.ftgo.restaurantservice.domain;
import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "restaurants")
@Access(AccessType.FIELD)
public class Restaurant {
@Id
@GeneratedValue
private Long id;
private String name;
@Embedded
private RestaurantMenu menu;
private Restaurant() {
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Restaurant(String name, RestaurantMenu menu) {
this.name = name;
this.menu = menu;
}
public Long getId() {
return id;
}
public RestaurantMenu getMenu() {
return menu;
}
}