1 | package com.example.db.model;
|
---|
2 |
|
---|
3 | import lombok.Data;
|
---|
4 |
|
---|
5 | import javax.persistence.*;
|
---|
6 | import java.time.ZonedDateTime;
|
---|
7 |
|
---|
8 | @Entity
|
---|
9 | @Data
|
---|
10 | @Table(name="shipping")
|
---|
11 | public class Shipping {
|
---|
12 | @Id
|
---|
13 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
---|
14 | Integer shipping_id;
|
---|
15 | String locations;
|
---|
16 | ZonedDateTime date_from;
|
---|
17 | ZonedDateTime date_to;
|
---|
18 |
|
---|
19 | @ManyToOne
|
---|
20 | @JoinColumn(name = "user_id")
|
---|
21 | public Users users;
|
---|
22 |
|
---|
23 | @ManyToOne
|
---|
24 | @JoinColumn(name = "shopping_id")
|
---|
25 | public ShoppingBag shoppingBag;
|
---|
26 |
|
---|
27 | public Shipping(Integer shipping_id, String locations, ZonedDateTime date_from, ZonedDateTime date_to, Users users, ShoppingBag shoppingBag) {
|
---|
28 | this.shipping_id = shipping_id;
|
---|
29 | this.locations = locations;
|
---|
30 | this.date_from = date_from;
|
---|
31 | this.date_to = date_to;
|
---|
32 | this.users = users;
|
---|
33 | this.shoppingBag = shoppingBag;
|
---|
34 | }
|
---|
35 |
|
---|
36 | public Shipping() {
|
---|
37 |
|
---|
38 | }
|
---|
39 |
|
---|
40 | public Integer getShipping_id() {
|
---|
41 | return shipping_id;
|
---|
42 | }
|
---|
43 |
|
---|
44 | public void setShipping_id(Integer shipping_id) {
|
---|
45 | this.shipping_id = shipping_id;
|
---|
46 | }
|
---|
47 |
|
---|
48 | public String getLocations() {
|
---|
49 | return locations;
|
---|
50 | }
|
---|
51 |
|
---|
52 | public void setLocations(String locations) {
|
---|
53 | this.locations = locations;
|
---|
54 | }
|
---|
55 |
|
---|
56 | public ZonedDateTime getDate_from() {
|
---|
57 | return date_from;
|
---|
58 | }
|
---|
59 |
|
---|
60 | public void setDate_from(ZonedDateTime date_from) {
|
---|
61 | this.date_from = date_from;
|
---|
62 | }
|
---|
63 |
|
---|
64 | public ZonedDateTime getDate_to() {
|
---|
65 | return date_to;
|
---|
66 | }
|
---|
67 |
|
---|
68 | public void setDate_to(ZonedDateTime date_to) {
|
---|
69 | this.date_to = date_to;
|
---|
70 | }
|
---|
71 |
|
---|
72 | public Users getUsers() {
|
---|
73 | return users;
|
---|
74 | }
|
---|
75 |
|
---|
76 | public void setUsers(Users users) {
|
---|
77 | this.users = users;
|
---|
78 | }
|
---|
79 |
|
---|
80 | public ShoppingBag getShoppingBag() {
|
---|
81 | return shoppingBag;
|
---|
82 | }
|
---|
83 |
|
---|
84 | public void setShoppingBag(ShoppingBag shoppingBag) {
|
---|
85 | this.shoppingBag = shoppingBag;
|
---|
86 | }
|
---|
87 | } |
---|