blob: baf29cad283bb8bd18fe856581efeae09f64df00 (
plain)
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
102
103
104
105
|
package jpa;
import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Set;
/**
* The persistent class for the product database table.
*
*/
@Entity
@Table(name="product")
@NamedQuery(name="Product.findAll", query="SELECT p FROM Product p")
public class Product implements Serializable {
private static final long serialVersionUID = 1L;
@Id
private int id;
@Lob
private String description;
private BigDecimal height;
private String name;
private BigDecimal price;
private BigDecimal width;
//bi-directional many-to-many association to Category
@ManyToMany
@JoinTable(
name="product_category"
, joinColumns={
@JoinColumn(name="product_id")
}
, inverseJoinColumns={
@JoinColumn(name="category_id")
}
)
private Set<Category> categories;
public Product() {
}
public int getId() {
return this.id;
}
public void setId(int id) {
this.id = id;
}
public String getDescription() {
return this.description;
}
public void setDescription(String description) {
this.description = description;
}
public BigDecimal getHeight() {
return this.height;
}
public void setHeight(BigDecimal height) {
this.height = height;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public BigDecimal getPrice() {
return this.price;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
public BigDecimal getWidth() {
return this.width;
}
public void setWidth(BigDecimal width) {
this.width = width;
}
public Set<Category> getCategories() {
return this.categories;
}
public void setCategories(Set<Category> categories) {
this.categories = categories;
}
}
|