-
Notifications
You must be signed in to change notification settings - Fork 199
/
Copy pathMenuProduct.java
73 lines (58 loc) · 1.6 KB
/
MenuProduct.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
package kitchenpos.domain.menu;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.ForeignKey;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import jakarta.persistence.Transient;
import kitchenpos.domain.product.Product;
import java.util.UUID;
@Table(name = "menu_product")
@Entity
public class MenuProduct {
@Column(name = "seq")
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Id
private Long seq;
@ManyToOne(optional = false)
@JoinColumn(
name = "product_id",
columnDefinition = "binary(16)",
foreignKey = @ForeignKey(name = "fk_menu_product_to_product")
)
private Product product;
@Column(name = "quantity", nullable = false)
private long quantity;
@Transient
private UUID productId;
public MenuProduct() {
}
public Long getSeq() {
return seq;
}
public void setSeq(final Long seq) {
this.seq = seq;
}
public Product getProduct() {
return product;
}
public void setProduct(final Product product) {
this.product = product;
}
public long getQuantity() {
return quantity;
}
public void setQuantity(final long quantity) {
this.quantity = quantity;
}
public UUID getProductId() {
return productId;
}
public void setProductId(final UUID productId) {
this.productId = productId;
}
}