-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathProduct.java
More file actions
101 lines (75 loc) · 1.86 KB
/
Copy pathProduct.java
File metadata and controls
101 lines (75 loc) · 1.86 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
93
94
95
96
97
98
99
100
101
package jpa;
import com.fasterxml.jackson.annotation.JsonBackReference;
import org.hibernate.annotations.Type;
import org.springframework.context.annotation.Primary;
import javax.persistence.*;
import java.util.Date;
@Entity
public class Product {
@Id
private int id;
@JoinColumn(name = "store_id", foreignKey = @ForeignKey(name="product_store_fk"))
@ManyToOne(targetEntity = Store.class, fetch = FetchType.LAZY)
private Store store;
@Column(name = "store_id", insertable = false, updatable = false)
private int store_id;
@Column
private String name;
@Column
private String description;
@Column
private double price;
@Column
private double score;
@Column
@Type(type = "date")
private Date create_at;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public Store getStore() {
return store;
}
public void setStore(Store store) {
this.store = store;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
public double getScore() {
return score;
}
public void setScore(double score) {
this.score = score;
}
public Date getCreate_at() {
return create_at;
}
public void setCreate_at(Date create_at) {
this.create_at = create_at;
}
public int getStore_id() {
return store_id;
}
public void setStore_id(int store_id) {
this.store_id = store_id;
}
}