Subversion Repositories SmartDukaan

Rev

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

Rev 22653 Rev 22859
Line 10... Line 10...
10
import javax.persistence.GeneratedValue;
10
import javax.persistence.GeneratedValue;
11
import javax.persistence.GenerationType;
11
import javax.persistence.GenerationType;
12
import javax.persistence.Id;
12
import javax.persistence.Id;
13
import javax.persistence.JoinColumn;
13
import javax.persistence.JoinColumn;
14
import javax.persistence.ManyToOne;
14
import javax.persistence.ManyToOne;
15
import javax.persistence.NamedQueries;
-
 
16
import javax.persistence.NamedQuery;
-
 
17
import javax.persistence.OneToMany;
15
import javax.persistence.OneToMany;
18
import javax.persistence.Table;
16
import javax.persistence.Table;
19
import javax.persistence.UniqueConstraint;
17
import javax.persistence.UniqueConstraint;
20
 
18
 
21
@Entity
19
@Entity
22
@Table(name="fofo.fofo_line_item", schema = "fofo", uniqueConstraints = {@UniqueConstraint(columnNames = {"order_id","item_id"})})
20
@Table(name="fofo.fofo_order_item", schema = "fofo", uniqueConstraints = {@UniqueConstraint(name = "UK_ORDER_ID_AND_ITEM_ID", columnNames = {"order_id","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{
21
public class FofoOrderItem implements Serializable{
28
 
22
 
29
	private static final long serialVersionUID = 1L;
23
	private static final long serialVersionUID = 1L;
30
 
24
 
31
	@Id
25
	@Id
32
	@Column(name = "id")
26
	@Column(name = "id")
Line 77... Line 71...
77
	
71
	
78
	@Column(name = "discount")
72
	@Column(name = "discount")
79
	private float discount;
73
	private float discount;
80
	
74
	
81
	@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY)
75
	@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY)
82
	@JoinColumn(name="fofo_line_item_id",insertable=false,updatable=false,nullable=false)
76
	@JoinColumn(name="fofo_order_item_id",insertable=false,updatable=false,nullable=false)
83
	private Set<FofoLineItemSerialNumber> fofoLineItemSerialNumbers;
77
	private Set<FofoLineItem> fofoLineItems;
84
	
78
	
85
	@ManyToOne(cascade=CascadeType.ALL,fetch=FetchType.LAZY)
79
	@ManyToOne(cascade=CascadeType.ALL,fetch=FetchType.LAZY)
86
	@JoinColumn(name="order_id",insertable=false,updatable=false,nullable=false, referencedColumnName="id")
80
	@JoinColumn(name="order_id",insertable=false,updatable=false,nullable=false, referencedColumnName="id")
87
	private FofoOrder order;
81
	private FofoOrder order;
88
	
82
	
Line 186... Line 180...
186
	
180
	
187
	public void setDiscount(float discount) {
181
	public void setDiscount(float discount) {
188
		this.discount = discount;
182
		this.discount = discount;
189
	}
183
	}
190
	
184
	
191
	public Set<FofoLineItemSerialNumber> getFofoLineItemSerialNumbers() {
185
	public Set<FofoLineItem> getFofoLineItems() {
192
		return fofoLineItemSerialNumbers;
186
		return fofoLineItems;
193
	}
187
	}
194
	public void setFofoLineItemSerialNumbers(Set<FofoLineItemSerialNumber> fofoLineItemSerialNumbers) {
188
	public void setFofoLineItems(Set<FofoLineItem> fofoLineItems) {
195
		this.fofoLineItemSerialNumbers = fofoLineItemSerialNumbers;
189
		this.fofoLineItems = fofoLineItems;
196
	}
190
	}
197
	
191
	
198
	public FofoOrder getOrder() {
192
	public FofoOrder getOrder() {
199
		return order;
193
		return order;
200
	}
194
	}
Line 216... Line 210...
216
			return true;
210
			return true;
217
		if (obj == null)
211
		if (obj == null)
218
			return false;
212
			return false;
219
		if (getClass() != obj.getClass())
213
		if (getClass() != obj.getClass())
220
			return false;
214
			return false;
221
		FofoLineItem other = (FofoLineItem) obj;
215
		FofoOrderItem other = (FofoOrderItem) obj;
222
		if (id != other.id)
216
		if (id != other.id)
223
			return false;
217
			return false;
224
		return true;
218
		return true;
225
	}
219
	}
-
 
220
	
226
	@Override
221
	@Override
227
	public String toString() {
222
	public String toString() {
228
		return "FofoLineItem [id=" + id + ", orderId=" + orderId + ", itemId=" + itemId + ", quantity=" + quantity
223
		return "FofoOrderItem [id=" + id + ", orderId=" + orderId + ", itemId=" + itemId + ", quantity=" + quantity
229
				+ ", sellingPrice=" + sellingPrice + ", cost=" + cost + ", igstRate=" + igstRate + ", cgstRate="
224
				+ ", sellingPrice=" + sellingPrice + ", cost=" + cost + ", igstRate=" + igstRate + ", cgstRate="
230
				+ cgstRate + ", sgstRate=" + sgstRate + ", hsnCode=" + hsnCode + ", dp=" + dp + ", brand=" + brand
225
				+ cgstRate + ", sgstRate=" + sgstRate + ", hsnCode=" + hsnCode + ", dp=" + dp + ", brand=" + brand
231
				+ ", modelName=" + modelName + ", modelNumber=" + modelNumber + ", color=" + color + ", discount="
226
				+ ", modelName=" + modelName + ", modelNumber=" + modelNumber + ", color=" + color + ", discount="
232
				+ discount + ", fofoLineItemSerialNumbers=" + fofoLineItemSerialNumbers + "]";
227
				+ discount + ", fofoLineItems=" + fofoLineItems + ", order=" + order + "]";
233
	}
228
	}
234
	
229
	
-
 
230
	
235
}
231
}