Rev 21895 | 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.fofo;import java.io.Serializable;import java.util.Set;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.OneToMany;import javax.persistence.Table;import javax.persistence.UniqueConstraint;@Entity@Table(name="fofo.fofo_line_item", schema = "fofo", uniqueConstraints = {@UniqueConstraint(columnNames = {"order_id","item_id"})})@NamedQueries({@NamedQuery(name = "FofoLineItem.selectById", query = "select fli from FofoLineItem fli where fli.id = :id"),@NamedQuery(name="FofoLineItem.selectByOrderId",query="select fli from FofoLineItem fli where fli.orderId = :orderId")})public class FofoLineItem implements Serializable{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 = "quantity")private int quantity;@Column(name = "selling_price")private float sellingPrice;@Column(name = "cost")private float cost;@Column(name = "igst_rate")private float igstRate;@Column(name = "cgst_rate")private float cgstRate;@Column(name = "sgst_rate")private float sgstRate;@Column(name = "hsn_code")private String hsnCode;@Column(name = "dp")private float dp;@Column(name = "brand")private String brand;@Column(name = "model_name")private String modelName;@Column(name = "model_number")private String modelNumber;@Column(name = "color")private String color;@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY)@JoinColumn(name="fofo_line_item_id",insertable=false,updatable=false,nullable=false)private Set<FofoLineItemSerialNumber> fofoLineItemSerialNumbers;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 float getCost() {return cost;}public void setCost(float cost) {this.cost = cost;}public float getIgstRate() {return igstRate;}public void setIgstRate(float igstRate) {this.igstRate = igstRate;}public float getCgstRate() {return cgstRate;}public void setCgstRate(float cgstRate) {this.cgstRate = cgstRate;}public float getSgstRate() {return sgstRate;}public void setSgstRate(float sgstRate) {this.sgstRate = sgstRate;}public String getHsnCode() {return hsnCode;}public void setHsnCode(String hsnCode) {this.hsnCode = hsnCode;}public float getDp() {return dp;}public void setDp(float dp) {this.dp = dp;}public String getBrand() {return brand;}public void setBrand(String brand) {this.brand = brand;}public String getModelName() {return modelName;}public void setModelName(String modelName) {this.modelName = modelName;}public String getModelNumber() {return modelNumber;}public void setModelNumber(String modelNumber) {this.modelNumber = modelNumber;}public String getColor() {return color;}public void setColor(String color) {this.color = color;}public Set<FofoLineItemSerialNumber> getFofoLineItemSerialNumbers() {return fofoLineItemSerialNumbers;}public void setFofoLineItemSerialNumbers(Set<FofoLineItemSerialNumber> fofoLineItemSerialNumbers) {this.fofoLineItemSerialNumbers = fofoLineItemSerialNumbers;}@Overridepublic int hashCode() {final int prime = 31;int result = 1;result = prime * result + ((brand == null) ? 0 : brand.hashCode());result = prime * result + Float.floatToIntBits(cgstRate);result = prime * result + ((color == null) ? 0 : color.hashCode());result = prime * result + Float.floatToIntBits(cost);result = prime * result + Float.floatToIntBits(dp);result = prime * result + ((fofoLineItemSerialNumbers == null) ? 0 : fofoLineItemSerialNumbers.hashCode());result = prime * result + ((hsnCode == null) ? 0 : hsnCode.hashCode());result = prime * result + id;result = prime * result + Float.floatToIntBits(igstRate);result = prime * result + itemId;result = prime * result + ((modelName == null) ? 0 : modelName.hashCode());result = prime * result + ((modelNumber == null) ? 0 : modelNumber.hashCode());result = prime * result + orderId;result = prime * result + quantity;result = prime * result + Float.floatToIntBits(sellingPrice);result = prime * result + Float.floatToIntBits(sgstRate);return result;}@Overridepublic boolean equals(Object obj) {if (this == obj)return true;if (obj == null)return false;if (getClass() != obj.getClass())return false;FofoLineItem other = (FofoLineItem) obj;if (brand == null) {if (other.brand != null)return false;} else if (!brand.equals(other.brand))return false;if (Float.floatToIntBits(cgstRate) != Float.floatToIntBits(other.cgstRate))return false;if (color == null) {if (other.color != null)return false;} else if (!color.equals(other.color))return false;if (Float.floatToIntBits(cost) != Float.floatToIntBits(other.cost))return false;if (Float.floatToIntBits(dp) != Float.floatToIntBits(other.dp))return false;if (fofoLineItemSerialNumbers == null) {if (other.fofoLineItemSerialNumbers != null)return false;} else if (!fofoLineItemSerialNumbers.equals(other.fofoLineItemSerialNumbers))return false;if (hsnCode == null) {if (other.hsnCode != null)return false;} else if (!hsnCode.equals(other.hsnCode))return false;if (id != other.id)return false;if (Float.floatToIntBits(igstRate) != Float.floatToIntBits(other.igstRate))return false;if (itemId != other.itemId)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 (orderId != other.orderId)return false;if (quantity != other.quantity)return false;if (Float.floatToIntBits(sellingPrice) != Float.floatToIntBits(other.sellingPrice))return false;if (Float.floatToIntBits(sgstRate) != Float.floatToIntBits(other.sgstRate))return false;return true;}@Overridepublic String toString() {return "FofoLineItem [id=" + id + ", orderId=" + orderId + ", itemId=" + itemId + ", quantity=" + quantity+ ", sellingPrice=" + sellingPrice + ", cost=" + cost + ", igstRate=" + igstRate + ", cgstRate="+ cgstRate + ", sgstRate=" + sgstRate + ", hsnCode=" + hsnCode + ", dp=" + dp + ", brand=" + brand+ ", modelName=" + modelName + ", modelNumber=" + modelNumber + ", color=" + color+ ", fofoLineItemSerialNumbers=" + fofoLineItemSerialNumbers + "]";}}