Rev 31860 | Go to most recent revision | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed
package com.spice.profitmandi.dao.entity.user;import in.shop2020.model.v1.user.CartStatus;import org.hibernate.annotations.UpdateTimestamp;import javax.persistence.*;import java.time.LocalDateTime;/*** This class basically contains cart details** @author ashikali**/@Entity@Table(name="user.cart")public class Cart {@Id@Column(name="id", unique=true, updatable=false)@GeneratedValue(strategy = GenerationType.IDENTITY)private int id;@Column(name = "wallet_amount")private double walletAmount;@Column(name = "total_price")private double totalPrice;@Column(name = "cart_status")private CartStatus cartStatus;@Column(name = "address_id")private Integer addressId;@Column(name="checked_out_on", updatable = false)private LocalDateTime checkoutTimestamp = LocalDateTime.now();@Column(name="created_on", updatable = false)private LocalDateTime createTimestamp = LocalDateTime.now();@Column(name="updated_on")@UpdateTimestampprivate LocalDateTime updateTimestamp = LocalDateTime.now();public int getId() {return id;}public void setId(int id) {this.id = id;}public double getWalletAmount() {return walletAmount;}public void setWalletAmount(double walletAmount) {this.walletAmount = walletAmount;}public double getTotalPrice() {return totalPrice;}public void setTotalPrice(double totalPrice) {this.totalPrice = totalPrice;}public CartStatus getCartStatus() {return cartStatus;}public void setCartStatus(CartStatus cartStatus) {this.cartStatus = cartStatus;}public Integer getAddressId() {return addressId;}public void setAddressId(Integer addressId) {this.addressId = addressId;}public LocalDateTime getCheckoutTimestamp() {return checkoutTimestamp;}public void setCheckoutTimestamp(LocalDateTime checkoutTimestamp) {this.checkoutTimestamp = checkoutTimestamp;}public LocalDateTime getCreateTimestamp() {return createTimestamp;}public void setCreateTimestamp(LocalDateTime createTimestamp) {this.createTimestamp = createTimestamp;}public LocalDateTime getUpdateTimestamp() {return updateTimestamp;}public void setUpdateTimestamp(LocalDateTime updateTimestamp) {this.updateTimestamp = updateTimestamp;}@Overridepublic int hashCode() {final int prime = 31;int result = 1;result = prime * result + id;return result;}@Overridepublic boolean equals(Object obj) {if (this == obj)return true;if (obj == null)return false;if (getClass() != obj.getClass())return false;Cart other = (Cart) obj;if (id != other.id)return false;return true;}@Overridepublic String toString() {return "Cart [id=" + id + ", walletAmount=" + walletAmount + ", totalPrice=" + totalPrice + ", cartStatus="+ cartStatus + ", addressId=" + addressId + ", checkoutTimestamp=" + checkoutTimestamp+ ", createTimestamp=" + createTimestamp + ", updateTimestamp=" + updateTimestamp + "]";}}