| Line 1... |
Line 1... |
| 1 |
package com.spice.profitmandi.dao.entity.fofo;
|
1 |
package com.spice.profitmandi.dao.entity.fofo;
|
| 2 |
|
2 |
|
| 3 |
import java.io.Serializable;
|
3 |
import java.io.Serializable;
|
| - |
|
4 |
import java.time.LocalDateTime;
|
| 4 |
import java.util.Set;
|
5 |
import java.util.Set;
|
| 5 |
|
6 |
|
| 6 |
import javax.persistence.CascadeType;
|
7 |
import javax.persistence.CascadeType;
|
| 7 |
import javax.persistence.Column;
|
8 |
import javax.persistence.Column;
|
| - |
|
9 |
import javax.persistence.Convert;
|
| 8 |
import javax.persistence.Entity;
|
10 |
import javax.persistence.Entity;
|
| 9 |
import javax.persistence.FetchType;
|
11 |
import javax.persistence.FetchType;
|
| 10 |
import javax.persistence.GeneratedValue;
|
12 |
import javax.persistence.GeneratedValue;
|
| 11 |
import javax.persistence.GenerationType;
|
13 |
import javax.persistence.GenerationType;
|
| 12 |
import javax.persistence.Id;
|
14 |
import javax.persistence.Id;
|
| Line 14... |
Line 16... |
| 14 |
import javax.persistence.ManyToOne;
|
16 |
import javax.persistence.ManyToOne;
|
| 15 |
import javax.persistence.OneToMany;
|
17 |
import javax.persistence.OneToMany;
|
| 16 |
import javax.persistence.Table;
|
18 |
import javax.persistence.Table;
|
| 17 |
import javax.persistence.UniqueConstraint;
|
19 |
import javax.persistence.UniqueConstraint;
|
| 18 |
|
20 |
|
| - |
|
21 |
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
|
| - |
|
22 |
|
| 19 |
@Entity
|
23 |
@Entity
|
| 20 |
@Table(name="fofo.fofo_order_item", schema = "fofo", uniqueConstraints = {@UniqueConstraint(name = "UK_ORDER_ID_AND_ITEM_ID", columnNames = {"order_id","item_id"})})
|
24 |
@Table(name="fofo.fofo_order_item", schema = "fofo", uniqueConstraints = {@UniqueConstraint(name = "UK_ORDER_ID_AND_ITEM_ID", columnNames = {"order_id","item_id"})})
|
| 21 |
public class FofoOrderItem implements Serializable{
|
25 |
public class FofoOrderItem implements Serializable{
|
| 22 |
|
26 |
|
| 23 |
private static final long serialVersionUID = 1L;
|
27 |
private static final long serialVersionUID = 1L;
|
| Line 70... |
Line 74... |
| 70 |
private String color;
|
74 |
private String color;
|
| 71 |
|
75 |
|
| 72 |
@Column(name = "discount")
|
76 |
@Column(name = "discount")
|
| 73 |
private float discount;
|
77 |
private float discount;
|
| 74 |
|
78 |
|
| - |
|
79 |
@Convert(converter = LocalDateTimeAttributeConverter.class)
|
| - |
|
80 |
@Column(name = "create_timestamp")
|
| - |
|
81 |
private LocalDateTime createTimestamp = LocalDateTime.now();
|
| - |
|
82 |
|
| 75 |
@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY)
|
83 |
@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY)
|
| 76 |
@JoinColumn(name="fofo_order_item_id",insertable=false,updatable=false,nullable=false)
|
84 |
@JoinColumn(name="fofo_order_item_id",insertable=false,updatable=false,nullable=false)
|
| 77 |
private Set<FofoLineItem> fofoLineItems;
|
85 |
private Set<FofoLineItem> fofoLineItems;
|
| 78 |
|
86 |
|
| 79 |
@ManyToOne(cascade=CascadeType.ALL,fetch=FetchType.LAZY)
|
87 |
@ManyToOne(cascade=CascadeType.ALL,fetch=FetchType.LAZY)
|
| Line 180... |
Line 188... |
| 180 |
|
188 |
|
| 181 |
public void setDiscount(float discount) {
|
189 |
public void setDiscount(float discount) {
|
| 182 |
this.discount = discount;
|
190 |
this.discount = discount;
|
| 183 |
}
|
191 |
}
|
| 184 |
|
192 |
|
| - |
|
193 |
public LocalDateTime getCreateTimestamp() {
|
| - |
|
194 |
return createTimestamp;
|
| - |
|
195 |
}
|
| - |
|
196 |
public void setCreateTimestamp(LocalDateTime createTimestamp) {
|
| - |
|
197 |
this.createTimestamp = createTimestamp;
|
| - |
|
198 |
}
|
| - |
|
199 |
|
| 185 |
public Set<FofoLineItem> getFofoLineItems() {
|
200 |
public Set<FofoLineItem> getFofoLineItems() {
|
| 186 |
return fofoLineItems;
|
201 |
return fofoLineItems;
|
| 187 |
}
|
202 |
}
|
| 188 |
public void setFofoLineItems(Set<FofoLineItem> fofoLineItems) {
|
203 |
public void setFofoLineItems(Set<FofoLineItem> fofoLineItems) {
|
| 189 |
this.fofoLineItems = fofoLineItems;
|
204 |
this.fofoLineItems = fofoLineItems;
|
| Line 215... |
Line 230... |
| 215 |
FofoOrderItem other = (FofoOrderItem) obj;
|
230 |
FofoOrderItem other = (FofoOrderItem) obj;
|
| 216 |
if (id != other.id)
|
231 |
if (id != other.id)
|
| 217 |
return false;
|
232 |
return false;
|
| 218 |
return true;
|
233 |
return true;
|
| 219 |
}
|
234 |
}
|
| 220 |
|
- |
|
| 221 |
@Override
|
235 |
@Override
|
| 222 |
public String toString() {
|
236 |
public String toString() {
|
| 223 |
return "FofoOrderItem [id=" + id + ", orderId=" + orderId + ", itemId=" + itemId + ", quantity=" + quantity
|
237 |
return "FofoOrderItem [id=" + id + ", orderId=" + orderId + ", itemId=" + itemId + ", quantity=" + quantity
|
| 224 |
+ ", sellingPrice=" + sellingPrice + ", cost=" + cost + ", igstRate=" + igstRate + ", cgstRate="
|
238 |
+ ", sellingPrice=" + sellingPrice + ", cost=" + cost + ", igstRate=" + igstRate + ", cgstRate="
|
| 225 |
+ cgstRate + ", sgstRate=" + sgstRate + ", hsnCode=" + hsnCode + ", dp=" + dp + ", brand=" + brand
|
239 |
+ cgstRate + ", sgstRate=" + sgstRate + ", hsnCode=" + hsnCode + ", dp=" + dp + ", brand=" + brand
|
| 226 |
+ ", modelName=" + modelName + ", modelNumber=" + modelNumber + ", color=" + color + ", discount="
|
240 |
+ ", modelName=" + modelName + ", modelNumber=" + modelNumber + ", color=" + color + ", discount="
|
| 227 |
+ discount + ", fofoLineItems=" + fofoLineItems + ", order=" + order + "]";
|
241 |
+ discount + ", createTimestamp=" + createTimestamp + ", fofoLineItems=" + fofoLineItems + ", order="
|
| - |
|
242 |
+ order + "]";
|
| 228 |
}
|
243 |
}
|
| 229 |
|
244 |
|
| 230 |
|
245 |
|
| - |
|
246 |
|
| 231 |
}
|
247 |
}
|