Rev 23301 | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed
package com.spice.profitmandi.dao.entity.dtr;import java.io.Serializable;import java.time.LocalDateTime;import javax.persistence.Column;import javax.persistence.Convert;import javax.persistence.Entity;import javax.persistence.EnumType;import javax.persistence.Enumerated;import javax.persistence.Id;import javax.persistence.Table;import javax.persistence.UniqueConstraint;import org.hibernate.annotations.UpdateTimestamp;import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;import com.spice.profitmandi.dao.enumuration.dtr.MonthlySaleVolume;import com.spice.profitmandi.dao.enumuration.dtr.PrimaryBuyingMode;import com.spice.profitmandi.dao.enumuration.dtr.RetailerType;import com.spice.profitmandi.dao.enumuration.dtr.SaleValue;/*** This class basically contains api details** @author ashikali**/@Entity@Table(name="dtr.retailer", uniqueConstraints = {@UniqueConstraint(columnNames = {"number","type"})})public class Retailer implements Serializable{private static final long serialVersionUID = 1L;public Retailer() {}@Id@Column(name = "id", unique=true, updatable=false)private int id;@Column(name = "name")private String name;@Column(name = "number", length = 128)private String number;@Column(name = "type")@Enumerated(EnumType.STRING)private RetailerType type;@Column(name = "monthly_sale_value")@Enumerated(EnumType.STRING)private SaleValue monthlySaleValue;@Column(name = "monthly_sale_volume")@Enumerated(EnumType.STRING)private MonthlySaleVolume monthlySaleVolume;@Column(name = "primary_buying_mode")@Enumerated(EnumType.STRING)private PrimaryBuyingMode primaryBuyingMode;@Column(name = "recharge", columnDefinition="tinyint(1) default 0")private boolean recharge;@Column(name = "mobile", columnDefinition="tinyint(1) default 0")private boolean mobile;@Column(name = "accessories", columnDefinition="tinyint(1) default 0")private boolean accessories;@Column(name = "other1", length = 128)private String other1;@Column(name = "other2", length = 128)private String other2;@Column(name = "self_pickup", columnDefinition="tinyint(1) default 0")private boolean selfPickup;@Column(name = "active", columnDefinition = "tinyint(1) default 0")private boolean active;@Column(name = "migrated", columnDefinition = "tinyint(1) default 0")private boolean migrated;@Convert(converter = LocalDateTimeAttributeConverter.class)@Column(name="create_timestamp", updatable = false)private LocalDateTime createTimestamp = LocalDateTime.now();@Convert(converter = LocalDateTimeAttributeConverter.class)@Column(name="update_timestamp")@UpdateTimestampprivate LocalDateTime updateTimestamp = LocalDateTime.now();@Column(name = "document_id")private Integer documentId;@Column(name = "current_address_id")private int currentAddressId;public int getId() {return id;}public void setId(int id) {this.id = id;}public void setName(String name) {this.name = name;}public String getName() {return name;}public String getNumber() {return number;}public void setNumber(String number) {this.number = number;}public SaleValue getMonthlySaleValue() {return monthlySaleValue;}public void setMonthlySaleValue(SaleValue monthlySaleValue) {this.monthlySaleValue = monthlySaleValue;}public MonthlySaleVolume getMonthlySaleVolume() {return monthlySaleVolume;}public void setMonthlySaleVolume(MonthlySaleVolume monthlySaleVolume) {this.monthlySaleVolume = monthlySaleVolume;}public PrimaryBuyingMode getPrimaryBuyingMode() {return primaryBuyingMode;}public void setPrimaryBuyingMode(PrimaryBuyingMode primaryBuyingMode) {this.primaryBuyingMode = primaryBuyingMode;}public boolean isRecharge() {return recharge;}public void setRecharge(boolean recharge) {this.recharge = recharge;}public boolean isMobile() {return mobile;}public void setMobile(boolean mobile) {this.mobile = mobile;}public boolean isAccessories() {return accessories;}public void setAccessories(boolean accessories) {this.accessories = accessories;}public String getOther1() {return other1;}public void setOther1(String other1) {this.other1 = other1;}public String getOther2() {return other2;}public void setOther2(String other2) {this.other2 = other2;}public void setType(RetailerType type) {this.type = type;}public RetailerType getType() {return type;}public Integer getDocumentId() {return documentId;}public void setDocumentId(Integer documentId) {this.documentId = documentId;}public void setCurrentAddressId(int currentAddressId) {this.currentAddressId = currentAddressId;}public int getCurrentAddressId() {return currentAddressId;}public boolean isSelfPickup() {return selfPickup;}public void setSelfPickup(boolean selfPickup) {this.selfPickup = selfPickup;}public boolean isActive() {return active;}public void setActive(boolean active) {this.active = active;}public boolean isMigrated() {return migrated;}public void setMigrated(boolean migrated) {this.migrated = migrated;}public void setCreateTimestamp(LocalDateTime createTimestamp) {this.createTimestamp = createTimestamp;}public LocalDateTime getCreateTimestamp() {return createTimestamp;}public void setUpdateTimestamp(LocalDateTime updateTimestamp) {this.updateTimestamp = updateTimestamp;}public LocalDateTime getUpdateTimestamp() {return 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;Retailer other = (Retailer) obj;if (id != other.id)return false;return true;}@Overridepublic String toString() {return "Retailer [id=" + id + ", name=" + name + ", number=" + number + ", type=" + type + ", monthlySaleValue="+ monthlySaleValue + ", monthlySaleVolume=" + monthlySaleVolume + ", primaryBuyingMode="+ primaryBuyingMode + ", recharge=" + recharge + ", mobile=" + mobile + ", accessories=" + accessories+ ", other1=" + other1 + ", other2=" + other2 + ", selfPickup=" + selfPickup + ", active=" + active+ ", migrated=" + migrated + ", createTimestamp=" + createTimestamp + ", updateTimestamp="+ updateTimestamp + ", documentId=" + documentId + ", currentAddressId=" + currentAddressId + "]";}}