1 | package com.example.db.model;
|
---|
2 |
|
---|
3 | import lombok.Data;
|
---|
4 |
|
---|
5 | import javax.persistence.*;
|
---|
6 |
|
---|
7 | @Entity
|
---|
8 | @Data
|
---|
9 | @Table(name="product")
|
---|
10 | public class Product {
|
---|
11 | @Id
|
---|
12 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
---|
13 | @Column(name = "product_id", nullable = false)
|
---|
14 | private Integer id;
|
---|
15 |
|
---|
16 | @Column(name = "names", nullable = false, length = 50)
|
---|
17 | private String names;
|
---|
18 |
|
---|
19 | @Column(name = "in_store", nullable = false)
|
---|
20 | private Boolean inStore = false;
|
---|
21 |
|
---|
22 | @Column(name = "sizes", nullable = false, length = 50)
|
---|
23 | private String sizes;
|
---|
24 |
|
---|
25 | @Column(name = "color", nullable = false, length = 50)
|
---|
26 | private String color;
|
---|
27 |
|
---|
28 | @ManyToOne(fetch = FetchType.LAZY, optional = false)
|
---|
29 | @JoinColumn(name = "category_id", nullable = false)
|
---|
30 | private Category category;
|
---|
31 |
|
---|
32 | public Category getCategory() {
|
---|
33 | return category;
|
---|
34 | }
|
---|
35 |
|
---|
36 | public void setCategory(Category category) {
|
---|
37 | this.category = category;
|
---|
38 | }
|
---|
39 |
|
---|
40 | public String getColor() {
|
---|
41 | return color;
|
---|
42 | }
|
---|
43 |
|
---|
44 | public void setColor(String color) {
|
---|
45 | this.color = color;
|
---|
46 | }
|
---|
47 |
|
---|
48 | public String getSizes() {
|
---|
49 | return sizes;
|
---|
50 | }
|
---|
51 |
|
---|
52 | public void setSizes(String sizes) {
|
---|
53 | this.sizes = sizes;
|
---|
54 | }
|
---|
55 |
|
---|
56 | public Boolean getInStore() {
|
---|
57 | return inStore;
|
---|
58 | }
|
---|
59 |
|
---|
60 | public void setInStore(Boolean inStore) {
|
---|
61 | this.inStore = inStore;
|
---|
62 | }
|
---|
63 |
|
---|
64 | public String getNames() {
|
---|
65 | return names;
|
---|
66 | }
|
---|
67 |
|
---|
68 | public void setNames(String names) {
|
---|
69 | this.names = names;
|
---|
70 | }
|
---|
71 |
|
---|
72 | public Integer getId() {
|
---|
73 | return id;
|
---|
74 | }
|
---|
75 |
|
---|
76 | public void setId(Integer id) {
|
---|
77 | this.id = id;
|
---|
78 | }
|
---|
79 | } |
---|