| 21714 |
ashik.ali |
1 |
package com.spice.profitmandi.dao.entity.fofo;
|
| 21596 |
ashik.ali |
2 |
|
|
|
3 |
import java.io.Serializable;
|
| 21687 |
ashik.ali |
4 |
import java.util.Set;
|
| 21596 |
ashik.ali |
5 |
|
| 21687 |
ashik.ali |
6 |
import javax.persistence.CascadeType;
|
| 21596 |
ashik.ali |
7 |
import javax.persistence.Column;
|
|
|
8 |
import javax.persistence.Entity;
|
| 21687 |
ashik.ali |
9 |
import javax.persistence.FetchType;
|
| 21596 |
ashik.ali |
10 |
import javax.persistence.GeneratedValue;
|
|
|
11 |
import javax.persistence.GenerationType;
|
|
|
12 |
import javax.persistence.Id;
|
| 21687 |
ashik.ali |
13 |
import javax.persistence.JoinColumn;
|
| 21596 |
ashik.ali |
14 |
import javax.persistence.NamedQueries;
|
|
|
15 |
import javax.persistence.NamedQuery;
|
| 21687 |
ashik.ali |
16 |
import javax.persistence.OneToMany;
|
| 21596 |
ashik.ali |
17 |
import javax.persistence.Table;
|
|
|
18 |
import javax.persistence.UniqueConstraint;
|
|
|
19 |
|
|
|
20 |
@Entity
|
|
|
21 |
@Table(name="fofo.fofo_line_item", schema = "fofo", uniqueConstraints = {@UniqueConstraint(columnNames = {"order_id","item_id"})})
|
|
|
22 |
@NamedQueries({
|
|
|
23 |
@NamedQuery(name = "FofoLineItem.selectById", query = "select fli from FofoLineItem fli where fli.id = :id"),
|
|
|
24 |
@NamedQuery(name="FofoLineItem.selectByOrderId",query="select fli from FofoLineItem fli where fli.orderId = :orderId")
|
|
|
25 |
})
|
|
|
26 |
public class FofoLineItem implements Serializable{
|
|
|
27 |
|
|
|
28 |
private static final long serialVersionUID = 1L;
|
|
|
29 |
|
|
|
30 |
@Id
|
|
|
31 |
@Column(name = "id")
|
|
|
32 |
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
|
33 |
private int id;
|
|
|
34 |
|
|
|
35 |
@Column(name = "order_id")
|
|
|
36 |
private int orderId;
|
|
|
37 |
|
|
|
38 |
@Column(name = "item_id")
|
|
|
39 |
private int itemId;
|
|
|
40 |
|
|
|
41 |
@Column(name = "quantity")
|
|
|
42 |
private int quantity;
|
|
|
43 |
|
|
|
44 |
@Column(name = "selling_price")
|
|
|
45 |
private float sellingPrice;
|
|
|
46 |
|
| 21710 |
ashik.ali |
47 |
@Column(name = "cost")
|
|
|
48 |
private float cost;
|
|
|
49 |
|
| 21895 |
ashik.ali |
50 |
@Column(name = "igst_rate")
|
|
|
51 |
private float igstRate;
|
| 21687 |
ashik.ali |
52 |
|
| 21895 |
ashik.ali |
53 |
@Column(name = "cgst_rate")
|
|
|
54 |
private float cgstRate;
|
| 21596 |
ashik.ali |
55 |
|
| 21895 |
ashik.ali |
56 |
@Column(name = "sgst_rate")
|
|
|
57 |
private float sgstRate;
|
|
|
58 |
|
|
|
59 |
@Column(name = "hsn_code")
|
|
|
60 |
private String hsnCode;
|
|
|
61 |
|
| 21596 |
ashik.ali |
62 |
@Column(name = "dp")
|
|
|
63 |
private float dp;
|
|
|
64 |
|
|
|
65 |
@Column(name = "brand")
|
|
|
66 |
private String brand;
|
|
|
67 |
|
|
|
68 |
@Column(name = "model_name")
|
|
|
69 |
private String modelName;
|
|
|
70 |
|
|
|
71 |
@Column(name = "model_number")
|
|
|
72 |
private String modelNumber;
|
|
|
73 |
|
|
|
74 |
@Column(name = "color")
|
|
|
75 |
private String color;
|
|
|
76 |
|
| 21687 |
ashik.ali |
77 |
@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY)
|
|
|
78 |
@JoinColumn(name="fofo_line_item_id",insertable=false,updatable=false,nullable=false)
|
|
|
79 |
private Set<FofoLineItemSerialNumber> fofoLineItemSerialNumbers;
|
| 21596 |
ashik.ali |
80 |
|
|
|
81 |
public int getId() {
|
|
|
82 |
return id;
|
|
|
83 |
}
|
|
|
84 |
public void setId(int id) {
|
|
|
85 |
this.id = id;
|
|
|
86 |
}
|
|
|
87 |
public int getOrderId() {
|
|
|
88 |
return orderId;
|
|
|
89 |
}
|
|
|
90 |
public void setOrderId(int orderId) {
|
|
|
91 |
this.orderId = orderId;
|
|
|
92 |
}
|
|
|
93 |
public int getItemId() {
|
|
|
94 |
return itemId;
|
|
|
95 |
}
|
|
|
96 |
public void setItemId(int itemId) {
|
|
|
97 |
this.itemId = itemId;
|
|
|
98 |
}
|
|
|
99 |
public int getQuantity() {
|
|
|
100 |
return quantity;
|
|
|
101 |
}
|
|
|
102 |
public void setQuantity(int quantity) {
|
|
|
103 |
this.quantity = quantity;
|
|
|
104 |
}
|
|
|
105 |
public float getSellingPrice() {
|
|
|
106 |
return sellingPrice;
|
|
|
107 |
}
|
|
|
108 |
public void setSellingPrice(float sellingPrice) {
|
|
|
109 |
this.sellingPrice = sellingPrice;
|
|
|
110 |
}
|
| 21710 |
ashik.ali |
111 |
|
|
|
112 |
public float getCost() {
|
|
|
113 |
return cost;
|
|
|
114 |
}
|
|
|
115 |
public void setCost(float cost) {
|
|
|
116 |
this.cost = cost;
|
|
|
117 |
}
|
|
|
118 |
|
| 21895 |
ashik.ali |
119 |
public float getIgstRate() {
|
|
|
120 |
return igstRate;
|
| 21596 |
ashik.ali |
121 |
}
|
| 21895 |
ashik.ali |
122 |
public void setIgstRate(float igstRate) {
|
|
|
123 |
this.igstRate = igstRate;
|
| 21596 |
ashik.ali |
124 |
}
|
| 21895 |
ashik.ali |
125 |
public float getCgstRate() {
|
|
|
126 |
return cgstRate;
|
| 21687 |
ashik.ali |
127 |
}
|
| 21895 |
ashik.ali |
128 |
public void setCgstRate(float cgstRate) {
|
|
|
129 |
this.cgstRate = cgstRate;
|
| 21687 |
ashik.ali |
130 |
}
|
| 21895 |
ashik.ali |
131 |
public float getSgstRate() {
|
|
|
132 |
return sgstRate;
|
|
|
133 |
}
|
|
|
134 |
public void setSgstRate(float sgstRate) {
|
|
|
135 |
this.sgstRate = sgstRate;
|
|
|
136 |
}
|
|
|
137 |
public String getHsnCode() {
|
|
|
138 |
return hsnCode;
|
|
|
139 |
}
|
|
|
140 |
public void setHsnCode(String hsnCode) {
|
|
|
141 |
this.hsnCode = hsnCode;
|
|
|
142 |
}
|
|
|
143 |
|
| 21596 |
ashik.ali |
144 |
public float getDp() {
|
|
|
145 |
return dp;
|
|
|
146 |
}
|
|
|
147 |
public void setDp(float dp) {
|
|
|
148 |
this.dp = dp;
|
|
|
149 |
}
|
|
|
150 |
public String getBrand() {
|
|
|
151 |
return brand;
|
|
|
152 |
}
|
|
|
153 |
public void setBrand(String brand) {
|
|
|
154 |
this.brand = brand;
|
|
|
155 |
}
|
|
|
156 |
public String getModelName() {
|
|
|
157 |
return modelName;
|
|
|
158 |
}
|
|
|
159 |
public void setModelName(String modelName) {
|
|
|
160 |
this.modelName = modelName;
|
|
|
161 |
}
|
|
|
162 |
public String getModelNumber() {
|
|
|
163 |
return modelNumber;
|
|
|
164 |
}
|
|
|
165 |
public void setModelNumber(String modelNumber) {
|
|
|
166 |
this.modelNumber = modelNumber;
|
|
|
167 |
}
|
|
|
168 |
public String getColor() {
|
|
|
169 |
return color;
|
|
|
170 |
}
|
|
|
171 |
public void setColor(String color) {
|
|
|
172 |
this.color = color;
|
|
|
173 |
}
|
| 21687 |
ashik.ali |
174 |
|
|
|
175 |
public Set<FofoLineItemSerialNumber> getFofoLineItemSerialNumbers() {
|
|
|
176 |
return fofoLineItemSerialNumbers;
|
|
|
177 |
}
|
|
|
178 |
public void setFofoLineItemSerialNumbers(Set<FofoLineItemSerialNumber> fofoLineItemSerialNumbers) {
|
|
|
179 |
this.fofoLineItemSerialNumbers = fofoLineItemSerialNumbers;
|
|
|
180 |
}
|
| 21924 |
ashik.ali |
181 |
|
|
|
182 |
|
| 21602 |
ashik.ali |
183 |
@Override
|
| 21924 |
ashik.ali |
184 |
public int hashCode() {
|
|
|
185 |
final int prime = 31;
|
|
|
186 |
int result = 1;
|
|
|
187 |
result = prime * result + ((brand == null) ? 0 : brand.hashCode());
|
|
|
188 |
result = prime * result + Float.floatToIntBits(cgstRate);
|
|
|
189 |
result = prime * result + ((color == null) ? 0 : color.hashCode());
|
|
|
190 |
result = prime * result + Float.floatToIntBits(cost);
|
|
|
191 |
result = prime * result + Float.floatToIntBits(dp);
|
|
|
192 |
result = prime * result + ((fofoLineItemSerialNumbers == null) ? 0 : fofoLineItemSerialNumbers.hashCode());
|
|
|
193 |
result = prime * result + ((hsnCode == null) ? 0 : hsnCode.hashCode());
|
|
|
194 |
result = prime * result + id;
|
|
|
195 |
result = prime * result + Float.floatToIntBits(igstRate);
|
|
|
196 |
result = prime * result + itemId;
|
|
|
197 |
result = prime * result + ((modelName == null) ? 0 : modelName.hashCode());
|
|
|
198 |
result = prime * result + ((modelNumber == null) ? 0 : modelNumber.hashCode());
|
|
|
199 |
result = prime * result + orderId;
|
|
|
200 |
result = prime * result + quantity;
|
|
|
201 |
result = prime * result + Float.floatToIntBits(sellingPrice);
|
|
|
202 |
result = prime * result + Float.floatToIntBits(sgstRate);
|
|
|
203 |
return result;
|
|
|
204 |
}
|
|
|
205 |
@Override
|
|
|
206 |
public boolean equals(Object obj) {
|
|
|
207 |
if (this == obj)
|
|
|
208 |
return true;
|
|
|
209 |
if (obj == null)
|
|
|
210 |
return false;
|
|
|
211 |
if (getClass() != obj.getClass())
|
|
|
212 |
return false;
|
|
|
213 |
FofoLineItem other = (FofoLineItem) obj;
|
|
|
214 |
if (brand == null) {
|
|
|
215 |
if (other.brand != null)
|
|
|
216 |
return false;
|
|
|
217 |
} else if (!brand.equals(other.brand))
|
|
|
218 |
return false;
|
|
|
219 |
if (Float.floatToIntBits(cgstRate) != Float.floatToIntBits(other.cgstRate))
|
|
|
220 |
return false;
|
|
|
221 |
if (color == null) {
|
|
|
222 |
if (other.color != null)
|
|
|
223 |
return false;
|
|
|
224 |
} else if (!color.equals(other.color))
|
|
|
225 |
return false;
|
|
|
226 |
if (Float.floatToIntBits(cost) != Float.floatToIntBits(other.cost))
|
|
|
227 |
return false;
|
|
|
228 |
if (Float.floatToIntBits(dp) != Float.floatToIntBits(other.dp))
|
|
|
229 |
return false;
|
|
|
230 |
if (fofoLineItemSerialNumbers == null) {
|
|
|
231 |
if (other.fofoLineItemSerialNumbers != null)
|
|
|
232 |
return false;
|
|
|
233 |
} else if (!fofoLineItemSerialNumbers.equals(other.fofoLineItemSerialNumbers))
|
|
|
234 |
return false;
|
|
|
235 |
if (hsnCode == null) {
|
|
|
236 |
if (other.hsnCode != null)
|
|
|
237 |
return false;
|
|
|
238 |
} else if (!hsnCode.equals(other.hsnCode))
|
|
|
239 |
return false;
|
|
|
240 |
if (id != other.id)
|
|
|
241 |
return false;
|
|
|
242 |
if (Float.floatToIntBits(igstRate) != Float.floatToIntBits(other.igstRate))
|
|
|
243 |
return false;
|
|
|
244 |
if (itemId != other.itemId)
|
|
|
245 |
return false;
|
|
|
246 |
if (modelName == null) {
|
|
|
247 |
if (other.modelName != null)
|
|
|
248 |
return false;
|
|
|
249 |
} else if (!modelName.equals(other.modelName))
|
|
|
250 |
return false;
|
|
|
251 |
if (modelNumber == null) {
|
|
|
252 |
if (other.modelNumber != null)
|
|
|
253 |
return false;
|
|
|
254 |
} else if (!modelNumber.equals(other.modelNumber))
|
|
|
255 |
return false;
|
|
|
256 |
if (orderId != other.orderId)
|
|
|
257 |
return false;
|
|
|
258 |
if (quantity != other.quantity)
|
|
|
259 |
return false;
|
|
|
260 |
if (Float.floatToIntBits(sellingPrice) != Float.floatToIntBits(other.sellingPrice))
|
|
|
261 |
return false;
|
|
|
262 |
if (Float.floatToIntBits(sgstRate) != Float.floatToIntBits(other.sgstRate))
|
|
|
263 |
return false;
|
|
|
264 |
return true;
|
|
|
265 |
}
|
|
|
266 |
@Override
|
| 21602 |
ashik.ali |
267 |
public String toString() {
|
|
|
268 |
return "FofoLineItem [id=" + id + ", orderId=" + orderId + ", itemId=" + itemId + ", quantity=" + quantity
|
| 21895 |
ashik.ali |
269 |
+ ", sellingPrice=" + sellingPrice + ", cost=" + cost + ", igstRate=" + igstRate + ", cgstRate="
|
|
|
270 |
+ cgstRate + ", sgstRate=" + sgstRate + ", hsnCode=" + hsnCode + ", dp=" + dp + ", brand=" + brand
|
|
|
271 |
+ ", modelName=" + modelName + ", modelNumber=" + modelNumber + ", color=" + color
|
|
|
272 |
+ ", fofoLineItemSerialNumbers=" + fofoLineItemSerialNumbers + "]";
|
| 21602 |
ashik.ali |
273 |
}
|
|
|
274 |
|
| 21596 |
ashik.ali |
275 |
}
|