Rev 23580 | 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.time.format.DateTimeFormatter;import javax.persistence.Column;import javax.persistence.Convert;import javax.persistence.Entity;import javax.persistence.GeneratedValue;import javax.persistence.GenerationType;import javax.persistence.Id;import javax.persistence.Table;import javax.persistence.UniqueConstraint;import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;@Entity@Table(name="fofo.prebooking_order", schema = "fofo", uniqueConstraints = {@UniqueConstraint(columnNames = {"item_id", "customer_mobile_number"})})public class PrebookingOrder implements Serializable{private static final long serialVersionUID = 1L;@Id@Column(name = "id")@GeneratedValue(strategy = GenerationType.IDENTITY)private int id;@Column(name = "fofo_id")private int fofoId;@Column(name = "customer_name")private String customerName;@Column(name = "customer_mobile_number")private String customerMobileNumber;@Column(name = "customer_email_id")private String customerEmailId;@Column(name = "item_id")private int itemId;@Column(name = "quantity")private int quantity;@Column(name = "available_quantity")private int availableQuantity;@Convert(converter = LocalDateTimeAttributeConverter.class)@Column(name = "complete_timestamp")private LocalDateTime completeTimestamp = null;@Convert(converter = LocalDateTimeAttributeConverter.class)@Column(name = "create_timestamp")private LocalDateTime createTimestamp = LocalDateTime.now();public int getId() {return id;}public void setId(int id) {this.id = id;}public int getFofoId() {return fofoId;}public void setFofoId(int fofoId) {this.fofoId = fofoId;}public String getCustomerName() {return customerName;}public void setCustomerName(String customerName) {this.customerName = customerName;}public String getCustomerMobileNumber() {return customerMobileNumber;}public void setCustomerMobileNumber(String customerMobileNumber) {this.customerMobileNumber = customerMobileNumber;}public String getCustomerEmailId() {return customerEmailId;}public void setCustomerEmailId(String customerEmailId) {this.customerEmailId = customerEmailId;}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 int getAvailableQuantity() {return availableQuantity;}public void setAvailableQuantity(int availableQuantity) {this.availableQuantity = availableQuantity;}public LocalDateTime getCompleteTimestamp() {return completeTimestamp;}public void setCompleteTimestamp(LocalDateTime completeTimestamp) {this.completeTimestamp = completeTimestamp;}public LocalDateTime getCreateTimestamp() {return createTimestamp;}public void setCreateTimestamp(LocalDateTime createTimestamp) {this.createTimestamp = createTimestamp;}public String getFormattedCreateTimestamp(){if(createTimestamp == null){return null;}DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-YYYY HH:mm");return createTimestamp.format(formatter);}@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;PrebookingOrder other = (PrebookingOrder) obj;if (id != other.id)return false;return true;}@Overridepublic String toString() {return "PrebookingOrder [id=" + id + ", fofoId=" + fofoId + ", customerName=" + customerName+ ", customerMobileNumber=" + customerMobileNumber + ", customerEmailId=" + customerEmailId+ ", itemId=" + itemId + ", quantity=" + quantity + ", availableQuantity=" + availableQuantity+ ", completeTimestamp=" + completeTimestamp + ", createTimestamp=" + createTimestamp + "]";}}