Subversion Repositories SmartDukaan

Rev

Rev 21716 | Rev 22009 | 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.transaction;

import java.io.Serializable;
import java.time.LocalDateTime;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.spice.profitmandi.dao.entity.catalog.Item;

/**
 * This class basically contains api details
 * 
 * @author ashikali
 *
 */
@Entity
@Table(name="transaction.lineitem", schema = "transaction")
@NamedQueries({
        @NamedQuery(name="LineItem.selectAll",query="select li from LineItem li"),
        @NamedQuery(name="LineItem.selectById",query="select li from LineItem li where li.id= :id")
})
public class LineItem implements Serializable{
        
        private static final long serialVersionUID = 1L;
        
        public LineItem() {
        }
        
        @Id
        @Column(name="id", unique=true, updatable=false)
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        private Integer id;
        
        @Column(name = "item_id")
        private Integer itemId;
        
        @Column(name = "productGroup", length = 100)
        private String productGoup;
        
        @Column(name = "brand", length = 100)
        private String brand;
        
        @Column(name = "model_number", length = 100)
        private String modelNumber;
        
        @Column(name = "model_name", length = 100)
        private String modelName;
        
        @Column(name = "color", length = 20)
        private String color;
        
        @Column(name = "extra_info", length = 100)
        private String extraInfo;
        
        @Column(name = "quantity")
        private Float quantity;
        
        @Column(name = "mrp")
        private Float mrp;
        
        @Column(name = "unit_price")
        private Float unitPrice;
        
        @Column(name = "unit_weight")
        private Float unitWeight;
        
        @Column(name = "total_price")
        private Float totalPrice;
        
        @Column(name = "transfer_price")
        private Float transferPrice;
        
        @Column(name = "total_weight")
        private Float totalWeight;
        
        @Column(name = "order_id")
        private Integer orderId;
        
        @Column(name = "imei_number", length = 20)
        private String imeiNumber;
        
        @Column(name = "item_number", length = 50)
        private String itemNumber;
        
        @Column(name = "dealText", length = 100)
        private String dealText;
        
        @Column(name = "warranty_expiry_timestamp")
        private LocalDateTime warrantyExpiryTimestamp;
        
        @Column(name = "serial_number", length = 8192)
        private String serialNumber;
        
        @Column(name = "vatRate")
        private Float vatRate;
        
        @Column(name = "nlc")
        private Float nlc;
        
        @Column(name = "logisticsCost")
        private Float logisticsCost;
        
        @Column(name = "codCollectionCharges")
        private Float codCollectionCharges;
        
        @Column(name = "returnQty")
        private Float returnQty;
        
        @Column(name = "damaged_expiry_timestamp")
        private LocalDateTime damagedExpiryTimestamp;
        
        @OneToOne(cascade=CascadeType.ALL,fetch=FetchType.LAZY)
        //@Fetch(value = FetchMode.SUBSELECT)
        @JoinColumn(name="item_id",insertable=false,updatable=false,nullable=false, referencedColumnName = "id")
        private Item item;
        
        public Integer getId() {
                return id;
        }
        public void setId(Integer id) {
                this.id = id;
        }
        public Integer getItemId() {
                return itemId;
        }
        public void setItemId(Integer itemId) {
                this.itemId = itemId;
        }
        public String getProductGoup() {
                return productGoup;
        }
        public void setProductGoup(String productGoup) {
                this.productGoup = productGoup;
        }
        public String getBrand() {
                return brand;
        }
        public void setBrand(String brand) {
                this.brand = brand;
        }
        public String getModelNumber() {
                return modelNumber;
        }
        public void setModelNumber(String modelNumber) {
                this.modelNumber = modelNumber;
        }
        
        public String getModelName() {
                return modelName;
        }
        public void setModelName(String modelName) {
                this.modelName = modelName;
        }
        public String getColor() {
                return color;
        }
        public void setColor(String color) {
                this.color = color;
        }
        public String getExtraInfo() {
                return extraInfo;
        }
        public void setExtraInfo(String extraInfo) {
                this.extraInfo = extraInfo;
        }
        public Float getQuantity() {
                return quantity;
        }
        public void setQuantity(Float quantity) {
                this.quantity = quantity;
        }
        public Float getMrp() {
                return mrp;
        }
        public void setMrp(Float mrp) {
                this.mrp = mrp;
        }
        public Float getUnitPrice() {
                return unitPrice;
        }
        public void setUnitPrice(Float unitPrice) {
                this.unitPrice = unitPrice;
        }
        public Float getUnitWeight() {
                return unitWeight;
        }
        public void setUnitWeight(Float unitWeight) {
                this.unitWeight = unitWeight;
        }
        public Float getTotalPrice() {
                return totalPrice;
        }
        public void setTotalPrice(Float totalPrice) {
                this.totalPrice = totalPrice;
        }
        public Float getTransferPrice() {
                return transferPrice;
        }
        public void setTransferPrice(Float transferPrice) {
                this.transferPrice = transferPrice;
        }
        public Float getTotalWeight() {
                return totalWeight;
        }
        public void setTotalWeight(Float totalWeight) {
                this.totalWeight = totalWeight;
        }
        public Integer getOrderId(){
                return orderId;
        }
        public void setOrderId(Integer orderId) {
                this.orderId = orderId;
        }
        public String getImeiNumber() {
                return imeiNumber;
        }
        public void setImeiNumber(String imeiNumber) {
                this.imeiNumber = imeiNumber;
        }
        public String getItemNumber() {
                return itemNumber;
        }
        public void setItemNumber(String itemNumber) {
                this.itemNumber = itemNumber;
        }
        public String getDealText() {
                return dealText;
        }
        public void setDealText(String dealText) {
                this.dealText = dealText;
        }
        public LocalDateTime getWarrantyExpiryTimestamp() {
                return warrantyExpiryTimestamp;
        }
        public void setWarrantyExpiryTimestamp(LocalDateTime warrantyExpiryTimestamp) {
                this.warrantyExpiryTimestamp = warrantyExpiryTimestamp;
        }
        public String getSerialNumber() {
                return serialNumber;
        }
        public void setSerialNumber(String serialNumber) {
                this.serialNumber = serialNumber;
        }
        public Float getVatRate() {
                return vatRate;
        }
        public void setVatRate(Float vatRate) {
                this.vatRate = vatRate;
        }
        public Float getNlc() {
                return nlc;
        }
        public void setNlc(Float nlc) {
                this.nlc = nlc;
        }
        public Float getLogisticsCost() {
                return logisticsCost;
        }
        public void setLogisticsCost(Float logisticsCost) {
                this.logisticsCost = logisticsCost;
        }
        public Float getCodCollectionCharges() {
                return codCollectionCharges;
        }
        public void setCodCollectionCharges(Float codCollectionCharges) {
                this.codCollectionCharges = codCollectionCharges;
        }
        public Float getReturnQty() {
                return returnQty;
        }
        public void setReturnQty(Float returnQty) {
                this.returnQty = returnQty;
        }
        public LocalDateTime getDamagedExpiryTimestamp() {
                return damagedExpiryTimestamp;
        }
        public void setDamagedExpiryTimestamp(LocalDateTime damagedExpiryTimestamp) {
                this.damagedExpiryTimestamp = damagedExpiryTimestamp;
        }
        
        public Item getItem() {
                return item;
        }
        public void setItem(Item item) {
                this.item = item;
        }
        
        
        @Override
        public int hashCode() {
                final int prime = 31;
                int result = 1;
                result = prime * result + ((brand == null) ? 0 : brand.hashCode());
                result = prime * result + ((codCollectionCharges == null) ? 0 : codCollectionCharges.hashCode());
                result = prime * result + ((color == null) ? 0 : color.hashCode());
                result = prime * result + ((damagedExpiryTimestamp == null) ? 0 : damagedExpiryTimestamp.hashCode());
                result = prime * result + ((dealText == null) ? 0 : dealText.hashCode());
                result = prime * result + ((extraInfo == null) ? 0 : extraInfo.hashCode());
                result = prime * result + ((id == null) ? 0 : id.hashCode());
                result = prime * result + ((imeiNumber == null) ? 0 : imeiNumber.hashCode());
                result = prime * result + ((item == null) ? 0 : item.hashCode());
                result = prime * result + ((itemId == null) ? 0 : itemId.hashCode());
                result = prime * result + ((itemNumber == null) ? 0 : itemNumber.hashCode());
                result = prime * result + ((logisticsCost == null) ? 0 : logisticsCost.hashCode());
                result = prime * result + ((modelName == null) ? 0 : modelName.hashCode());
                result = prime * result + ((modelNumber == null) ? 0 : modelNumber.hashCode());
                result = prime * result + ((mrp == null) ? 0 : mrp.hashCode());
                result = prime * result + ((nlc == null) ? 0 : nlc.hashCode());
                result = prime * result + ((orderId == null) ? 0 : orderId.hashCode());
                result = prime * result + ((productGoup == null) ? 0 : productGoup.hashCode());
                result = prime * result + ((quantity == null) ? 0 : quantity.hashCode());
                result = prime * result + ((returnQty == null) ? 0 : returnQty.hashCode());
                result = prime * result + ((serialNumber == null) ? 0 : serialNumber.hashCode());
                result = prime * result + ((totalPrice == null) ? 0 : totalPrice.hashCode());
                result = prime * result + ((totalWeight == null) ? 0 : totalWeight.hashCode());
                result = prime * result + ((transferPrice == null) ? 0 : transferPrice.hashCode());
                result = prime * result + ((unitPrice == null) ? 0 : unitPrice.hashCode());
                result = prime * result + ((unitWeight == null) ? 0 : unitWeight.hashCode());
                result = prime * result + ((vatRate == null) ? 0 : vatRate.hashCode());
                result = prime * result + ((warrantyExpiryTimestamp == null) ? 0 : warrantyExpiryTimestamp.hashCode());
                return result;
        }
        @Override
        public boolean equals(Object obj) {
                if (this == obj)
                        return true;
                if (obj == null)
                        return false;
                if (getClass() != obj.getClass())
                        return false;
                LineItem other = (LineItem) obj;
                if (brand == null) {
                        if (other.brand != null)
                                return false;
                } else if (!brand.equals(other.brand))
                        return false;
                if (codCollectionCharges == null) {
                        if (other.codCollectionCharges != null)
                                return false;
                } else if (!codCollectionCharges.equals(other.codCollectionCharges))
                        return false;
                if (color == null) {
                        if (other.color != null)
                                return false;
                } else if (!color.equals(other.color))
                        return false;
                if (damagedExpiryTimestamp == null) {
                        if (other.damagedExpiryTimestamp != null)
                                return false;
                } else if (!damagedExpiryTimestamp.equals(other.damagedExpiryTimestamp))
                        return false;
                if (dealText == null) {
                        if (other.dealText != null)
                                return false;
                } else if (!dealText.equals(other.dealText))
                        return false;
                if (extraInfo == null) {
                        if (other.extraInfo != null)
                                return false;
                } else if (!extraInfo.equals(other.extraInfo))
                        return false;
                if (id == null) {
                        if (other.id != null)
                                return false;
                } else if (!id.equals(other.id))
                        return false;
                if (imeiNumber == null) {
                        if (other.imeiNumber != null)
                                return false;
                } else if (!imeiNumber.equals(other.imeiNumber))
                        return false;
                if (item == null) {
                        if (other.item != null)
                                return false;
                } else if (!item.equals(other.item))
                        return false;
                if (itemId == null) {
                        if (other.itemId != null)
                                return false;
                } else if (!itemId.equals(other.itemId))
                        return false;
                if (itemNumber == null) {
                        if (other.itemNumber != null)
                                return false;
                } else if (!itemNumber.equals(other.itemNumber))
                        return false;
                if (logisticsCost == null) {
                        if (other.logisticsCost != null)
                                return false;
                } else if (!logisticsCost.equals(other.logisticsCost))
                        return false;
                if (modelName == null) {
                        if (other.modelName != null)
                                return false;
                } else if (!modelName.equals(other.modelName))
                        return false;
                if (modelNumber == null) {
                        if (other.modelNumber != null)
                                return false;
                } else if (!modelNumber.equals(other.modelNumber))
                        return false;
                if (mrp == null) {
                        if (other.mrp != null)
                                return false;
                } else if (!mrp.equals(other.mrp))
                        return false;
                if (nlc == null) {
                        if (other.nlc != null)
                                return false;
                } else if (!nlc.equals(other.nlc))
                        return false;
                if (orderId == null) {
                        if (other.orderId != null)
                                return false;
                } else if (!orderId.equals(other.orderId))
                        return false;
                if (productGoup == null) {
                        if (other.productGoup != null)
                                return false;
                } else if (!productGoup.equals(other.productGoup))
                        return false;
                if (quantity == null) {
                        if (other.quantity != null)
                                return false;
                } else if (!quantity.equals(other.quantity))
                        return false;
                if (returnQty == null) {
                        if (other.returnQty != null)
                                return false;
                } else if (!returnQty.equals(other.returnQty))
                        return false;
                if (serialNumber == null) {
                        if (other.serialNumber != null)
                                return false;
                } else if (!serialNumber.equals(other.serialNumber))
                        return false;
                if (totalPrice == null) {
                        if (other.totalPrice != null)
                                return false;
                } else if (!totalPrice.equals(other.totalPrice))
                        return false;
                if (totalWeight == null) {
                        if (other.totalWeight != null)
                                return false;
                } else if (!totalWeight.equals(other.totalWeight))
                        return false;
                if (transferPrice == null) {
                        if (other.transferPrice != null)
                                return false;
                } else if (!transferPrice.equals(other.transferPrice))
                        return false;
                if (unitPrice == null) {
                        if (other.unitPrice != null)
                                return false;
                } else if (!unitPrice.equals(other.unitPrice))
                        return false;
                if (unitWeight == null) {
                        if (other.unitWeight != null)
                                return false;
                } else if (!unitWeight.equals(other.unitWeight))
                        return false;
                if (vatRate == null) {
                        if (other.vatRate != null)
                                return false;
                } else if (!vatRate.equals(other.vatRate))
                        return false;
                if (warrantyExpiryTimestamp == null) {
                        if (other.warrantyExpiryTimestamp != null)
                                return false;
                } else if (!warrantyExpiryTimestamp.equals(other.warrantyExpiryTimestamp))
                        return false;
                return true;
        }
        @Override
        public String toString() {
                return "LineItem [id=" + id + ", itemId=" + itemId + ", productGoup=" + productGoup + ", brand=" + brand
                                + ", modelNumber=" + modelNumber + ", modelName=" + modelName + ", color=" + color + ", extraInfo="
                                + extraInfo + ", quantity=" + quantity + ", mrp=" + mrp + ", unitPrice=" + unitPrice + ", unitWeight="
                                + unitWeight + ", totalPrice=" + totalPrice + ", transferPrice=" + transferPrice + ", totalWeight="
                                + totalWeight + ", orderId=" + orderId + ", imeiNumber=" + imeiNumber + ", itemNumber=" + itemNumber
                                + ", dealText=" + dealText + ", warrantyExpiryTimestamp=" + warrantyExpiryTimestamp + ", serialNumber="
                                + serialNumber + ", vatRate=" + vatRate + ", nlc=" + nlc + ", logisticsCost=" + logisticsCost
                                + ", codCollectionCharges=" + codCollectionCharges + ", returnQty=" + returnQty
                                + ", damagedExpiryTimestamp=" + damagedExpiryTimestamp + ", item=" + item + "]";
        }
        
}