Subversion Repositories SmartDukaan

Rev

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

Rev 21924 Rev 21984
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.time.LocalDateTime;
-
 
5
import java.util.List;
5
 
6
 
-
 
7
import javax.persistence.CascadeType;
6
import javax.persistence.Column;
8
import javax.persistence.Column;
7
import javax.persistence.Entity;
9
import javax.persistence.Entity;
-
 
10
import javax.persistence.FetchType;
8
import javax.persistence.GeneratedValue;
11
import javax.persistence.GeneratedValue;
9
import javax.persistence.GenerationType;
12
import javax.persistence.GenerationType;
10
import javax.persistence.Id;
13
import javax.persistence.Id;
-
 
14
import javax.persistence.JoinColumn;
-
 
15
import javax.persistence.ManyToOne;
11
import javax.persistence.NamedQueries;
16
import javax.persistence.NamedQueries;
12
import javax.persistence.NamedQuery;
17
import javax.persistence.NamedQuery;
-
 
18
import javax.persistence.OneToMany;
13
import javax.persistence.Table;
19
import javax.persistence.Table;
14
 
20
 
15
@Entity
21
@Entity
16
@Table(name="fofo.fofo_order", schema = "fofo")
22
@Table(name="fofo.fofo_order", schema = "fofo")
17
@NamedQueries({
23
@NamedQueries({
Line 46... Line 52...
46
	private String invoiceNumber;
52
	private String invoiceNumber;
47
	
53
	
48
	@Column(name = "create_timestamp")
54
	@Column(name = "create_timestamp")
49
	private LocalDateTime createTimestamp = LocalDateTime.now();
55
	private LocalDateTime createTimestamp = LocalDateTime.now();
50
	
56
	
51
	public int getId() {
-
 
52
		return id;
-
 
53
	}
-
 
54
	public void setId(int id) {
-
 
55
		this.id = id;
-
 
56
	}
-
 
57
	public int getFofoId() {
-
 
58
		return fofoId;
-
 
59
	}
-
 
60
	public void setFofoId(int fofoId) {
-
 
61
		this.fofoId = fofoId;
-
 
62
	}
-
 
63
	public int getCustomerId() {
-
 
64
		return customerId;
-
 
65
	}
-
 
66
	public void setCustomerId(int customerId) {
-
 
67
		this.customerId = customerId;
-
 
68
	}
-
 
69
	public int getCustomerAddressId() {
-
 
70
		return customerAddressId;
-
 
71
	}
-
 
72
	public void setCustomerAddressId(int customerAddressId) {
57
	@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY)
73
		this.customerAddressId = customerAddressId;
-
 
74
	}
-
 
75
	public float getTotalAmount() {
-
 
76
		return totalAmount;
-
 
77
	}
-
 
78
	public void setTotalAmount(float totalAmount) {
-
 
79
		this.totalAmount = totalAmount;
-
 
80
	}
-
 
81
	public String getInvoiceNumber() {
-
 
82
		return invoiceNumber;
-
 
83
	}
-
 
84
	public void setInvoiceNumber(String invoiceNumber) {
-
 
85
		this.invoiceNumber = invoiceNumber;
-
 
86
	}
-
 
87
	public LocalDateTime getCreateTimestamp() {
-
 
88
		return createTimestamp;
-
 
89
	}
-
 
90
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
58
	@JoinColumn(name="order_id",insertable=false,updatable=false,nullable=false)
91
		this.createTimestamp = createTimestamp;
59
	private List<FofoLineItem> fofoLineItem;	
92
	}
-
 
93
	
-
 
94
	
60
	
95
	@Override
61
	@Override
96
	public int hashCode() {
62
	public int hashCode() {
97
		final int prime = 31;
63
		final int prime = 31;
98
		int result = 1;
64
		int result = 1;
99
		result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
65
		result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
-
 
66
		result = prime * result + ((customer == null) ? 0 : customer.hashCode());
100
		result = prime * result + customerAddressId;
67
		result = prime * result + customerAddressId;
101
		result = prime * result + customerId;
68
		result = prime * result + customerId;
102
		result = prime * result + fofoId;
69
		result = prime * result + fofoId;
-
 
70
		result = prime * result + ((fofoLineItem == null) ? 0 : fofoLineItem.hashCode());
103
		result = prime * result + id;
71
		result = prime * result + id;
104
		result = prime * result + ((invoiceNumber == null) ? 0 : invoiceNumber.hashCode());
72
		result = prime * result + ((invoiceNumber == null) ? 0 : invoiceNumber.hashCode());
-
 
73
		result = prime * result + ((paymentOption == null) ? 0 : paymentOption.hashCode());
105
		result = prime * result + Float.floatToIntBits(totalAmount);
74
		result = prime * result + Float.floatToIntBits(totalAmount);
106
		return result;
75
		return result;
107
	}
76
	}
108
	@Override
77
	@Override
109
	public boolean equals(Object obj) {
78
	public boolean equals(Object obj) {
Line 117... Line 86...
117
		if (createTimestamp == null) {
86
		if (createTimestamp == null) {
118
			if (other.createTimestamp != null)
87
			if (other.createTimestamp != null)
119
				return false;
88
				return false;
120
		} else if (!createTimestamp.equals(other.createTimestamp))
89
		} else if (!createTimestamp.equals(other.createTimestamp))
121
			return false;
90
			return false;
-
 
91
		if (customer == null) {
-
 
92
			if (other.customer != null)
-
 
93
				return false;
-
 
94
		} else if (!customer.equals(other.customer))
-
 
95
			return false;
122
		if (customerAddressId != other.customerAddressId)
96
		if (customerAddressId != other.customerAddressId)
123
			return false;
97
			return false;
124
		if (customerId != other.customerId)
98
		if (customerId != other.customerId)
125
			return false;
99
			return false;
126
		if (fofoId != other.fofoId)
100
		if (fofoId != other.fofoId)
127
			return false;
101
			return false;
-
 
102
		if (fofoLineItem == null) {
-
 
103
			if (other.fofoLineItem != null)
-
 
104
				return false;
-
 
105
		} else if (!fofoLineItem.equals(other.fofoLineItem))
-
 
106
			return false;
128
		if (id != other.id)
107
		if (id != other.id)
129
			return false;
108
			return false;
130
		if (invoiceNumber == null) {
109
		if (invoiceNumber == null) {
131
			if (other.invoiceNumber != null)
110
			if (other.invoiceNumber != null)
132
				return false;
111
				return false;
133
		} else if (!invoiceNumber.equals(other.invoiceNumber))
112
		} else if (!invoiceNumber.equals(other.invoiceNumber))
134
			return false;
113
			return false;
-
 
114
		if (paymentOption == null) {
-
 
115
			if (other.paymentOption != null)
-
 
116
				return false;
-
 
117
		} else if (!paymentOption.equals(other.paymentOption))
-
 
118
			return false;
135
		if (Float.floatToIntBits(totalAmount) != Float.floatToIntBits(other.totalAmount))
119
		if (Float.floatToIntBits(totalAmount) != Float.floatToIntBits(other.totalAmount))
136
			return false;
120
			return false;
137
		return true;
121
		return true;
138
	}
122
	}
-
 
123
	@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY)
-
 
124
	@JoinColumn(name="order_id",insertable=false,updatable=false,nullable=false)
-
 
125
	private List<PaymentOption> paymentOption;	
-
 
126
	
-
 
127
	public List<PaymentOption> getPaymentOption() {
-
 
128
		return paymentOption;
-
 
129
	}
-
 
130
	public void setPaymentOption(List<PaymentOption> paymentOption) {
-
 
131
		this.paymentOption = paymentOption;
-
 
132
	}
-
 
133
	public List<FofoLineItem> getFofoLineItem() {
-
 
134
		return fofoLineItem;
-
 
135
	}
-
 
136
	public void setFofoLineItem(List<FofoLineItem> fofoLineItem) {
-
 
137
		this.fofoLineItem = fofoLineItem;
-
 
138
	}
-
 
139
	@ManyToOne(cascade=CascadeType.ALL,fetch=FetchType.LAZY)
-
 
140
	@JoinColumn(name="customer_id",insertable=false,updatable=false,nullable=false, referencedColumnName="id")
-
 
141
	private Customer customer;	
-
 
142
	
-
 
143
	public Customer getCustomer() {
-
 
144
		return customer;
-
 
145
	}
-
 
146
	public void setCustomer(Customer customer) {
-
 
147
		this.customer = customer;
-
 
148
	}
-
 
149
	public int getId() {
-
 
150
		return id;
-
 
151
	}
-
 
152
	public void setId(int id) {
-
 
153
		this.id = id;
-
 
154
	}
-
 
155
	public int getFofoId() {
-
 
156
		return fofoId;
-
 
157
	}
-
 
158
	public void setFofoId(int fofoId) {
-
 
159
		this.fofoId = fofoId;
-
 
160
	}
-
 
161
	public int getCustomerId() {
-
 
162
		return customerId;
-
 
163
	}
-
 
164
	public void setCustomerId(int customerId) {
-
 
165
		this.customerId = customerId;
-
 
166
	}
-
 
167
	public int getCustomerAddressId() {
-
 
168
		return customerAddressId;
-
 
169
	}
-
 
170
	public void setCustomerAddressId(int customerAddressId) {
-
 
171
		this.customerAddressId = customerAddressId;
-
 
172
	}
-
 
173
	public float getTotalAmount() {
-
 
174
		return totalAmount;
-
 
175
	}
-
 
176
	public void setTotalAmount(float totalAmount) {
-
 
177
		this.totalAmount = totalAmount;
-
 
178
	}
-
 
179
	public String getInvoiceNumber() {
-
 
180
		return invoiceNumber;
-
 
181
	}
-
 
182
	public void setInvoiceNumber(String invoiceNumber) {
-
 
183
		this.invoiceNumber = invoiceNumber;
-
 
184
	}
-
 
185
	public LocalDateTime getCreateTimestamp() {
-
 
186
		return createTimestamp;
-
 
187
	}
-
 
188
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
-
 
189
		this.createTimestamp = createTimestamp;
-
 
190
	}
139
	@Override
191
	@Override
140
	public String toString() {
192
	public String toString() {
141
		return "FofoOrder [id=" + id + ", fofoId=" + fofoId + ", customerId=" + customerId + ", customerAddressId="
193
		return "FofoOrder [id=" + id + ", fofoId=" + fofoId + ", customerId=" + customerId + ", customerAddressId="
142
				+ customerAddressId + ", totalAmount=" + totalAmount + ", invoiceNumber=" + invoiceNumber
194
				+ customerAddressId + ", totalAmount=" + totalAmount + ", invoiceNumber=" + invoiceNumber
-
 
195
				+ ", createTimestamp=" + createTimestamp + ", fofoLineItem=" + fofoLineItem + ", paymentOption="
143
				+ ", createTimestamp=" + createTimestamp + "]";
196
				+ paymentOption + ", customer=" + customer + "]";
144
	}
197
	}
145
	
198
	
146
	
199
	
147
}
200
}