Subversion Repositories SmartDukaan

Rev

Rev 31860 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
22352 ashik.ali 1
package com.spice.profitmandi.dao.entity.user;
2
 
32556 amit.gupta 3
import in.shop2020.model.v1.user.CartStatus;
22352 ashik.ali 4
import org.hibernate.annotations.UpdateTimestamp;
5
 
32556 amit.gupta 6
import javax.persistence.*;
7
import java.time.LocalDateTime;
22352 ashik.ali 8
 
9
/**
10
 * This class basically contains cart details
11
 * 
12
 * @author ashikali
13
 *
14
 */
15
@Entity
31860 tejbeer 16
@Table(name="user.cart")
22352 ashik.ali 17
 
18
public class Cart {
19
 
20
	@Id
21
	@Column(name="id", unique=true, updatable=false)
22
	@GeneratedValue(strategy = GenerationType.IDENTITY)
23
	private int id;
24
 
25
	@Column(name = "wallet_amount")
28653 amit.gupta 26
	private double walletAmount;
22352 ashik.ali 27
 
28
	@Column(name = "total_price")
28653 amit.gupta 29
	private double totalPrice;
22352 ashik.ali 30
 
31
	@Column(name = "cart_status")
32
	private CartStatus cartStatus;
33
 
34
	@Column(name = "address_id")
32556 amit.gupta 35
	private Integer addressId;
22352 ashik.ali 36
 
37
	@Column(name="checked_out_on", updatable = false)
38
	private LocalDateTime checkoutTimestamp = LocalDateTime.now();
39
 
40
	@Column(name="created_on", updatable = false)
41
	private LocalDateTime createTimestamp = LocalDateTime.now();
42
 
43
	@Column(name="updated_on")
44
	@UpdateTimestamp
45
	private LocalDateTime updateTimestamp = LocalDateTime.now();
46
 
47
 
48
	public int getId() {
49
		return id;
50
	}
51
 
52
	public void setId(int id) {
53
		this.id = id;
54
	}
55
 
56
 
57
 
28653 amit.gupta 58
	public double getWalletAmount() {
22352 ashik.ali 59
		return walletAmount;
60
	}
61
 
28653 amit.gupta 62
	public void setWalletAmount(double walletAmount) {
22352 ashik.ali 63
		this.walletAmount = walletAmount;
64
	}
65
 
28653 amit.gupta 66
	public double getTotalPrice() {
22352 ashik.ali 67
		return totalPrice;
68
	}
69
 
28653 amit.gupta 70
	public void setTotalPrice(double totalPrice) {
22352 ashik.ali 71
		this.totalPrice = totalPrice;
72
	}
73
 
74
	public CartStatus getCartStatus() {
75
		return cartStatus;
76
	}
77
 
78
	public void setCartStatus(CartStatus cartStatus) {
79
		this.cartStatus = cartStatus;
80
	}
81
 
32556 amit.gupta 82
	public Integer getAddressId() {
22352 ashik.ali 83
		return addressId;
84
	}
85
 
32556 amit.gupta 86
	public void setAddressId(Integer addressId) {
22352 ashik.ali 87
		this.addressId = addressId;
88
	}
89
 
90
	public LocalDateTime getCheckoutTimestamp() {
91
		return checkoutTimestamp;
92
	}
93
 
94
	public void setCheckoutTimestamp(LocalDateTime checkoutTimestamp) {
95
		this.checkoutTimestamp = checkoutTimestamp;
96
	}
97
 
98
	public LocalDateTime getCreateTimestamp() {
99
		return createTimestamp;
100
	}
101
 
102
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
103
		this.createTimestamp = createTimestamp;
104
	}
105
 
106
	public LocalDateTime getUpdateTimestamp() {
107
		return updateTimestamp;
108
	}
109
 
110
	public void setUpdateTimestamp(LocalDateTime updateTimestamp) {
111
		this.updateTimestamp = updateTimestamp;
112
	}
113
 
114
	@Override
115
	public int hashCode() {
116
		final int prime = 31;
117
		int result = 1;
118
		result = prime * result + id;
119
		return result;
120
	}
121
 
122
	@Override
123
	public boolean equals(Object obj) {
124
		if (this == obj)
125
			return true;
126
		if (obj == null)
127
			return false;
128
		if (getClass() != obj.getClass())
129
			return false;
130
		Cart other = (Cart) obj;
131
		if (id != other.id)
132
			return false;
133
		return true;
134
	}
135
 
136
	@Override
137
	public String toString() {
138
		return "Cart [id=" + id + ", walletAmount=" + walletAmount + ", totalPrice=" + totalPrice + ", cartStatus="
139
				+ cartStatus + ", addressId=" + addressId + ", checkoutTimestamp=" + checkoutTimestamp
140
				+ ", createTimestamp=" + createTimestamp + ", updateTimestamp=" + updateTimestamp + "]";
141
	}
142
 
143
 
144
}