Rev 28344 | Rev 28407 | 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.fofo;import java.io.Serializable;import java.time.LocalDateTime;import java.util.List;import javax.persistence.Column;import javax.persistence.Convert;import javax.persistence.Entity;import javax.persistence.EnumType;import javax.persistence.Enumerated;import javax.persistence.GeneratedValue;import javax.persistence.GenerationType;import javax.persistence.Id;import javax.persistence.Table;import javax.persistence.Transient;import javax.persistence.UniqueConstraint;import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;import com.spice.profitmandi.dao.enumuration.transaction.OrderStatus;@Entity@Table(name = "fofo.pending_order_item", schema = "fofo", uniqueConstraints = {@UniqueConstraint(name = "UK_ORDER_ID_AND_ITEM_ID", columnNames = { "order_id", "item_id" }) })public class PendingOrderItem implements Serializable {public OrderStatus getStatus() {return status;}public String getItemName() {return itemName;}public void setItemName(String itemName) {this.itemName = itemName;}private static final long serialVersionUID = 1L;@Id@Column(name = "id")@GeneratedValue(strategy = GenerationType.IDENTITY)private int id;@Column(name = "order_id")private int orderId;@Column(name = "item_id")private int itemId;@Column(name = "remark")private String remark;public String getRemark() {return remark;}public void setRemark(String remark) {this.remark = remark;}@Transientprivate String itemName;@Transientprivate String imgUrl;public String getImgUrl() {return imgUrl;}public void setImgUrl(String imgUrl) {this.imgUrl = imgUrl;}@Column(name = "quantity")private int quantity;@Column(name = "selling_price")private float sellingPrice;@Transientprivate PendingOrder pendingOrder;public PendingOrder getPendingOrder() {return pendingOrder;}public void setPendingOrder(PendingOrder pendingOrder) {this.pendingOrder = pendingOrder;}@Column(name = "status")@Enumerated(EnumType.STRING)private OrderStatus status;@Column(name = "status_description")private String statusDescription;@Column(name = "cancelled_timestamp")private LocalDateTime cancelledTimestamp;@Column(name = "billed_timestamp")private LocalDateTime billedTimestamp;@Column(name = "verified_timestamp")private LocalDateTime verifiedTimestamp;public LocalDateTime getVerifiedTimestamp() {return verifiedTimestamp;}public void setVerifiedTimestamp(LocalDateTime verifiedTimestamp) {this.verifiedTimestamp = verifiedTimestamp;}@Column(name = "delivered_timestamp")private LocalDateTime deliveredTimestamp;@Column(name = "claimed_timestamp")private LocalDateTime claimedTimestamp;public LocalDateTime getClaimedTimestamp() {return claimedTimestamp;}public void setClaimedTimestamp(LocalDateTime claimedTimestamp) {this.claimedTimestamp = claimedTimestamp;}public LocalDateTime getDeliveredTimestamp() {return deliveredTimestamp;}public void setDeliveredTimestamp(LocalDateTime deliveredTimestamp) {this.deliveredTimestamp = deliveredTimestamp;}public String getStatusDescription() {return statusDescription;}public LocalDateTime getBilledTimestamp() {return billedTimestamp;}public void setBilledTimestamp(LocalDateTime billedTimestamp) {this.billedTimestamp = billedTimestamp;}public void setStatusDescription(String statusDescription) {this.statusDescription = statusDescription;}public void setStatus(OrderStatus status) {this.status = status;}public LocalDateTime getCancelledTimestamp() {return cancelledTimestamp;}public void setCancelledTimestamp(LocalDateTime cancelledTimestamp) {this.cancelledTimestamp = cancelledTimestamp;}@Column(name = "scheduled_delivery_time")private LocalDateTime scheduledDeliveryTime;@Convert(converter = LocalDateTimeAttributeConverter.class)@Column(name = "create_timestamp")private LocalDateTime createTimestamp = LocalDateTime.now();@Overridepublic int hashCode() {final int prime = 31;int result = 1;result = prime * result + ((billedTimestamp == null) ? 0 : billedTimestamp.hashCode());result = prime * result + ((cancelledTimestamp == null) ? 0 : cancelledTimestamp.hashCode());result = prime * result + ((claimedTimestamp == null) ? 0 : claimedTimestamp.hashCode());result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());result = prime * result + ((deliveredTimestamp == null) ? 0 : deliveredTimestamp.hashCode());result = prime * result + id;result = prime * result + ((imgUrl == null) ? 0 : imgUrl.hashCode());result = prime * result + itemId;result = prime * result + ((itemName == null) ? 0 : itemName.hashCode());result = prime * result + orderId;result = prime * result + ((pendingOrder == null) ? 0 : pendingOrder.hashCode());result = prime * result + quantity;result = prime * result + ((remark == null) ? 0 : remark.hashCode());result = prime * result + ((scheduledDeliveryTime == null) ? 0 : scheduledDeliveryTime.hashCode());result = prime * result + Float.floatToIntBits(sellingPrice);result = prime * result + ((status == null) ? 0 : status.hashCode());result = prime * result + ((statusDescription == null) ? 0 : statusDescription.hashCode());result = prime * result + ((verifiedTimestamp == null) ? 0 : verifiedTimestamp.hashCode());return result;}@Overridepublic boolean equals(Object obj) {if (this == obj)return true;if (obj == null)return false;if (getClass() != obj.getClass())return false;PendingOrderItem other = (PendingOrderItem) obj;if (billedTimestamp == null) {if (other.billedTimestamp != null)return false;} else if (!billedTimestamp.equals(other.billedTimestamp))return false;if (cancelledTimestamp == null) {if (other.cancelledTimestamp != null)return false;} else if (!cancelledTimestamp.equals(other.cancelledTimestamp))return false;if (claimedTimestamp == null) {if (other.claimedTimestamp != null)return false;} else if (!claimedTimestamp.equals(other.claimedTimestamp))return false;if (createTimestamp == null) {if (other.createTimestamp != null)return false;} else if (!createTimestamp.equals(other.createTimestamp))return false;if (deliveredTimestamp == null) {if (other.deliveredTimestamp != null)return false;} else if (!deliveredTimestamp.equals(other.deliveredTimestamp))return false;if (id != other.id)return false;if (imgUrl == null) {if (other.imgUrl != null)return false;} else if (!imgUrl.equals(other.imgUrl))return false;if (itemId != other.itemId)return false;if (itemName == null) {if (other.itemName != null)return false;} else if (!itemName.equals(other.itemName))return false;if (orderId != other.orderId)return false;if (pendingOrder == null) {if (other.pendingOrder != null)return false;} else if (!pendingOrder.equals(other.pendingOrder))return false;if (quantity != other.quantity)return false;if (remark == null) {if (other.remark != null)return false;} else if (!remark.equals(other.remark))return false;if (scheduledDeliveryTime == null) {if (other.scheduledDeliveryTime != null)return false;} else if (!scheduledDeliveryTime.equals(other.scheduledDeliveryTime))return false;if (Float.floatToIntBits(sellingPrice) != Float.floatToIntBits(other.sellingPrice))return false;if (status != other.status)return false;if (statusDescription == null) {if (other.statusDescription != null)return false;} else if (!statusDescription.equals(other.statusDescription))return false;if (verifiedTimestamp == null) {if (other.verifiedTimestamp != null)return false;} else if (!verifiedTimestamp.equals(other.verifiedTimestamp))return false;return true;}public LocalDateTime getScheduledDeliveryTime() {return scheduledDeliveryTime;}public void setScheduledDeliveryTime(LocalDateTime scheduledDeliveryTime) {this.scheduledDeliveryTime = scheduledDeliveryTime;}public int getId() {return id;}public void setId(int id) {this.id = id;}public int getOrderId() {return orderId;}public void setOrderId(int orderId) {this.orderId = orderId;}public int getItemId() {return itemId;}public void setItemId(int itemId) {this.itemId = itemId;}public int getQuantity() {return quantity;}public void setQuantity(int quantity) {this.quantity = quantity;}public float getSellingPrice() {return sellingPrice;}public void setSellingPrice(float sellingPrice) {this.sellingPrice = sellingPrice;}public LocalDateTime getCreateTimestamp() {return createTimestamp;}public void setCreateTimestamp(LocalDateTime createTimestamp) {this.createTimestamp = createTimestamp;}public static long getSerialversionuid() {return serialVersionUID;}@Overridepublic String toString() {return "PendingOrderItem [id=" + id + ", orderId=" + orderId + ", itemId=" + itemId + ", remark=" + remark+ ", itemName=" + itemName + ", imgUrl=" + imgUrl + ", quantity=" + quantity + ", sellingPrice="+ sellingPrice + ", pendingOrder=" + pendingOrder + ", status=" + status + ", statusDescription="+ statusDescription + ", cancelledTimestamp=" + cancelledTimestamp + ", billedTimestamp="+ billedTimestamp + ", verifiedTimestamp=" + verifiedTimestamp + ", deliveredTimestamp="+ deliveredTimestamp + ", claimedTimestamp=" + claimedTimestamp + ", scheduledDeliveryTime="+ scheduledDeliveryTime + ", createTimestamp=" + createTimestamp + "]";}}