-
Notifications
You must be signed in to change notification settings - Fork 199
/
Copy pathMenuProduct.java
64 lines (49 loc) · 1.27 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
package kitchenpos.menu.domain.model;
import jakarta.persistence.*;
import kitchenpos.product.domain.model.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;
}
}