Subversion Repositories SmartDukaan

Rev

Rev 22653 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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