Rev 32671 | Rev 33680 | 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.dtr;import com.spice.profitmandi.dao.enumuration.inventory.ScratchedGift;import javax.persistence.*;import java.io.Serializable;import java.time.LocalDateTime;@Entity@Table(name = "dtr.scratch_offer")@NamedQueries({@NamedQuery(name = "ScratchOffer.selectAllCountOfOffer",query = "SELECT so.offerName, COUNT(so) FROM ScratchOffer so " +"WHERE so.createdTimestamp BETWEEN :startDate AND :endDate " +"GROUP BY so.offerName")})public class ScratchOffer implements Serializable {/****/private static final long serialVersionUID = 1L;@Id@Column(name = "id", unique = true, updatable = false)@GeneratedValue(strategy = GenerationType.IDENTITY)private int id;@Column(name = "invoice_number")private String invoiceNumber;@Column(name = "customer_id")private int customerId;@Column(name = "offer_name")@Enumerated(EnumType.STRING)private ScratchedGift offerName;@Column(name = "scratched")private boolean scratched;@Column(name = "created_timestamp")private LocalDateTime createdTimestamp;@Column(name = "unlocked_at")private LocalDateTime unlockedAt;@Column(name = "scracthed_at")private LocalDateTime scracthedAt;public LocalDateTime getScracthedAt() {return scracthedAt;}public void setScracthedAt(LocalDateTime scracthedAt) {this.scracthedAt = scracthedAt;}@Transientprivate boolean unlocked;@Transientprivate LocalDateTime expiredTimestamp;@Transientprivate boolean expired;public boolean isExpired() {return expired;}public void setExpired(boolean expired) {this.expired = expired;}public LocalDateTime getExpiredTimestamp() {return expiredTimestamp;}public void setExpiredTimestamp(LocalDateTime expiredTimestamp) {this.expiredTimestamp = expiredTimestamp;}public boolean isUnlocked() {return unlocked;}public void setUnlocked(boolean unlocked) {this.unlocked = unlocked;}public LocalDateTime getUnlockedAt() {return unlockedAt;}public void setUnlockedAt(LocalDateTime unlockedAt) {this.unlockedAt = unlockedAt;}public int getId() {return id;}public void setId(int id) {this.id = id;}public int getCustomerId() {return customerId;}public void setCustomerId(int customerId) {this.customerId = customerId;}public String getInvoiceNumber() {return invoiceNumber;}public void setInvoiceNumber(String invoiceNumber) {this.invoiceNumber = invoiceNumber;}public ScratchedGift getOfferName() {return offerName;}public void setOfferName(ScratchedGift offerName) {this.offerName = offerName;}public boolean isScratched() {return scratched;}public void setScratched(boolean scratched) {this.scratched = scratched;}public LocalDateTime getCreatedTimestamp() {return createdTimestamp;}public void setCreatedTimestamp(LocalDateTime createdTimestamp) {this.createdTimestamp = createdTimestamp;}@Overridepublic int hashCode() {final int prime = 31;int result = 1;result = prime * result + ((createdTimestamp == null) ? 0 : createdTimestamp.hashCode());result = prime * result + customerId;result = prime * result + ((expiredTimestamp == null) ? 0 : expiredTimestamp.hashCode());result = prime * result + id;result = prime * result + ((invoiceNumber == null) ? 0 : invoiceNumber.hashCode());result = prime * result + ((offerName == null) ? 0 : offerName.hashCode());result = prime * result + ((scracthedAt == null) ? 0 : scracthedAt.hashCode());result = prime * result + (scratched ? 1231 : 1237);result = prime * result + (unlocked ? 1231 : 1237);result = prime * result + ((unlockedAt == null) ? 0 : unlockedAt.hashCode());return result;}@Overridepublic boolean equals(Object obj) {if (this == obj)return true;if (obj == null)return false;if (getClass() != obj.getClass())return false;ScratchOffer other = (ScratchOffer) obj;if (createdTimestamp == null) {if (other.createdTimestamp != null)return false;} else if (!createdTimestamp.equals(other.createdTimestamp))return false;if (customerId != other.customerId)return false;if (expiredTimestamp == null) {if (other.expiredTimestamp != null)return false;} else if (!expiredTimestamp.equals(other.expiredTimestamp))return false;if (id != other.id)return false;if (invoiceNumber == null) {if (other.invoiceNumber != null)return false;} else if (!invoiceNumber.equals(other.invoiceNumber))return false;if (offerName != other.offerName)return false;if (scracthedAt == null) {if (other.scracthedAt != null)return false;} else if (!scracthedAt.equals(other.scracthedAt))return false;if (scratched != other.scratched)return false;if (unlocked != other.unlocked)return false;if (unlockedAt == null) {if (other.unlockedAt != null)return false;} else if (!unlockedAt.equals(other.unlockedAt))return false;return true;}@Overridepublic String toString() {return "ScratchOffer [id=" + id + ", invoiceNumber=" + invoiceNumber + ", customerId=" + customerId+ ", offerName=" + offerName + ", scratched=" + scratched + ", createdTimestamp=" + createdTimestamp+ ", unlockedAt=" + unlockedAt + ", scracthedAt=" + scracthedAt + ", unlocked=" + unlocked+ ", expiredTimestamp=" + expiredTimestamp + "]";}}