Subversion Repositories SmartDukaan

Rev

Rev 23269 | Rev 24440 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
22216 ashik.ali 1
package com.spice.profitmandi.dao.entity.dtr;
2
 
3
import java.io.Serializable;
22243 ashik.ali 4
import java.time.LocalDate;
22216 ashik.ali 5
import java.time.LocalDateTime;
6
 
7
import javax.persistence.Column;
8
import javax.persistence.Convert;
9
import javax.persistence.Entity;
10
import javax.persistence.GeneratedValue;
11
import javax.persistence.GenerationType;
12
import javax.persistence.Id;
13
import javax.persistence.Table;
23344 ashik.ali 14
import javax.persistence.Transient;
22216 ashik.ali 15
 
16
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
17
 
18
/**
19
 * This class basically contains insurance details
20
 * 
21
 * @author ashikali
22
 *
23
 */
24
@Entity
25
@Table(name="dtr.insurance_policy", schema = "dtr")
26
public class InsurancePolicy implements Serializable{
27
 
28
	private static final long serialVersionUID = 1L;
29
 
30
	public InsurancePolicy() {
31
	}
32
 
33
	@Id
34
	@Column(name="id", unique=true, updatable=false)
35
	@GeneratedValue(strategy = GenerationType.IDENTITY)
36
	private int id;
37
 
38
	@Column(name = "invoice_number")
39
	private String invoiceNumber;
40
 
41
	@Column(name="retailer_id")
42
	private int retailerId;
43
 
44
	@Column(name= "purchase_amount")
45
	private float purchaseAmount;
46
 
47
	@Column(name= "sale_amount")
48
	private float saleAmount;
49
 
50
	@Column(name= "selling_price")
51
	private float sellingPrice;
52
 
53
	@Column(name = "serial_number", unique = true)
54
	private String serialNumber;
55
 
56
	@Column(name = "model_name")
57
	private String modelName;
58
 
59
	@Column(name = "brand")
60
	private String brand;
61
 
62
	@Column(name = "policy_number")
63
	private String policyNumber;
64
 
65
	@Column(name="provider_id")
66
	private int providerId;
67
 
22243 ashik.ali 68
	@Column(name = "customer_first_name")
69
	private String customerFirstName;
70
 
71
	@Column(name = "customer_last_name")
72
	private String customerLastName;
73
 
74
	@Column(name = "customer_mobile_number")
75
	private String customerMobileNumber;
76
 
77
	@Column(name = "customer_email_id")
78
	private String customerEmailId;
79
 
80
	@Column(name = "customer_date_of_birth")
81
	private LocalDate customerDateOfBirth = LocalDate.now();
82
 
83
	@Column(name = "customer_address1")
84
	private String customerAddress1;
85
 
86
	@Column(name = "customer_address2")
87
	private String customerAddress2;
88
 
89
	@Column(name = "customer_city")
90
	private String customerCity;
91
 
92
	@Column(name = "customer_pin_code")
93
	private String customerPinCode;
94
 
95
	@Column(name = "customer_state")
96
	private String customerState;
97
 
98
	@Column(name = "posted", columnDefinition = "tinyint(1) default 0")
99
	private boolean posted;
100
 
23344 ashik.ali 101
	@Transient
102
	private InsuranceProvider insuranceProvider;
103
 
22216 ashik.ali 104
	@Convert(converter = LocalDateTimeAttributeConverter.class)
105
	@Column(name="create_timestamp", updatable = false)
106
	private LocalDateTime createTimestamp = LocalDateTime.now();
107
 
108
	@Convert(converter = LocalDateTimeAttributeConverter.class)
109
	@Column(name="invoice_creation_timestamp")
110
	private LocalDateTime invoiceCreationTimestamp = LocalDateTime.now();
22243 ashik.ali 111
 
22216 ashik.ali 112
 
113
	public int getId() {
114
		return id;
115
	}
116
 
117
	public void setId(int id) {
118
		this.id = id;
119
	}
120
 
121
	public String getInvoiceNumber() {
122
		return invoiceNumber;
123
	}
124
	public void setInvoiceNumber(String invoiceNumber) {
125
		this.invoiceNumber = invoiceNumber;
126
	}
127
 
128
	public int getRetailerId() {
129
		return retailerId;
130
	}
131
 
132
	public void setRetailerId(int retailerId) {
133
		this.retailerId = retailerId;
134
	}
135
 
136
	public float getPurchaseAmount() {
137
		return purchaseAmount;
138
	}
139
 
140
	public void setPurchaseAmount(float purchaseAmount) {
141
		this.purchaseAmount = purchaseAmount;
142
	}
143
 
144
	public float getSaleAmount() {
145
		return saleAmount;
146
	}
147
 
148
	public void setSaleAmount(float saleAmount) {
149
		this.saleAmount = saleAmount;
150
	}
151
 
152
	public float getSellingPrice() {
153
		return sellingPrice;
154
	}
155
 
156
	public void setSellingPrice(float sellingPrice) {
157
		this.sellingPrice = sellingPrice;
158
	}
159
 
160
	public String getSerialNumber() {
161
		return serialNumber;
162
	}
163
 
164
	public void setSerialNumber(String serialNumber) {
165
		this.serialNumber = serialNumber;
166
	}
167
 
168
	public String getModelName() {
169
		return modelName;
170
	}
171
	public void setModelName(String modelName) {
172
		this.modelName = modelName;
173
	}
174
 
175
	public String getBrand() {
176
		return brand;
177
	}
178
	public void setBrand(String brand) {
179
		this.brand = brand;
180
	}
181
 
182
	public String getPolicyNumber() {
183
		return policyNumber;
184
	}
185
 
186
	public void setPolicyNumber(String policyNumber) {
187
		this.policyNumber = policyNumber;
188
	}
189
 
190
	public int getProviderId() {
191
		return providerId;
192
	}
193
 
194
	public void setProviderId(int providerId) {
195
		this.providerId = providerId;
196
	}
22243 ashik.ali 197
 
198
	public String getCustomerFirstName() {
199
		return customerFirstName;
200
	}
201
	public void setCustomerFirstName(String customerFirstName) {
202
		this.customerFirstName = customerFirstName;
203
	}
204
	public String getCustomerLastName() {
205
		return customerLastName;
206
	}
207
	public void setCustomerLastName(String customerLastName) {
208
		this.customerLastName = customerLastName;
209
	}
210
	public String getCustomerMobileNumber() {
211
		return customerMobileNumber;
212
	}
213
	public void setCustomerMobileNumber(String customerMobileNumber) {
214
		this.customerMobileNumber = customerMobileNumber;
215
	}
216
	public String getCustomerEmailId() {
217
		return customerEmailId;
218
	}
219
	public void setCustomerEmailId(String customerEmailId) {
220
		this.customerEmailId = customerEmailId;
221
	}
222
	public LocalDate getCustomerDateOfBirth() {
223
		return customerDateOfBirth;
224
	}
225
	public void setCustomerDateOfBirth(LocalDate customerDateOfBirth) {
226
		this.customerDateOfBirth = customerDateOfBirth;
227
	}
228
	public String getCustomerAddress1() {
229
		return customerAddress1;
230
	}
231
	public void setCustomerAddress1(String customerAddress1) {
232
		this.customerAddress1 = customerAddress1;
233
	}
234
	public String getCustomerAddress2() {
235
		return customerAddress2;
236
	}
237
	public void setCustomerAddress2(String customerAddress2) {
238
		this.customerAddress2 = customerAddress2;
239
	}
240
	public String getCustomerCity() {
241
		return customerCity;
242
	}
243
	public void setCustomerCity(String customerCity) {
244
		this.customerCity = customerCity;
245
	}
246
	public String getCustomerPinCode() {
247
		return customerPinCode;
248
	}
249
	public void setCustomerPinCode(String customerPinCode) {
250
		this.customerPinCode = customerPinCode;
251
	}
252
	public String getCustomerState() {
253
		return customerState;
254
	}
255
	public void setCustomerState(String customerState) {
256
		this.customerState = customerState;
257
	}
22216 ashik.ali 258
 
22243 ashik.ali 259
	public boolean isPosted() {
260
		return posted;
261
	}
262
 
263
	public void setPosted(boolean posted) {
264
		this.posted = posted;
265
	}
23344 ashik.ali 266
 
267
	public InsuranceProvider getInsuranceProvider() {
268
		return insuranceProvider;
269
	}
270
 
271
	public void setInsuranceProvider(InsuranceProvider insuranceProvider) {
272
		this.insuranceProvider = insuranceProvider;
273
	}
274
 
22216 ashik.ali 275
	public LocalDateTime getCreateTimestamp() {
276
		return createTimestamp;
277
	}
278
 
279
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
280
		this.createTimestamp = createTimestamp;
281
	}
282
 
283
	public LocalDateTime getInvoiceCreationTimestamp() {
284
		return invoiceCreationTimestamp;
285
	}
286
 
287
	public void setInvoiceCreationTimestamp(LocalDateTime invoiceCreationTimestamp) {
288
		this.invoiceCreationTimestamp = invoiceCreationTimestamp;
289
	}
290
 
291
	@Override
292
	public int hashCode() {
293
		final int prime = 31;
294
		int result = 1;
295
		result = prime * result + id;
296
		return result;
297
	}
298
 
299
	@Override
300
	public boolean equals(Object obj) {
301
		if (this == obj)
302
			return true;
303
		if (obj == null)
304
			return false;
305
		if (getClass() != obj.getClass())
306
			return false;
307
		InsurancePolicy other = (InsurancePolicy) obj;
308
		if (id != other.id)
309
			return false;
310
		return true;
311
	}
312
 
313
	@Override
314
	public String toString() {
315
		return "InsurancePolicy [id=" + id + ", invoiceNumber=" + invoiceNumber + ", retailerId=" + retailerId
316
				+ ", purchaseAmount=" + purchaseAmount + ", saleAmount=" + saleAmount + ", sellingPrice=" + sellingPrice
317
				+ ", serialNumber=" + serialNumber + ", modelName=" + modelName + ", brand=" + brand + ", policyNumber="
22243 ashik.ali 318
				+ policyNumber + ", providerId=" + providerId + ", customerFirstName=" + customerFirstName
319
				+ ", customerLastName=" + customerLastName + ", customerMobileNumber=" + customerMobileNumber
320
				+ ", customerEmailId=" + customerEmailId + ", customerDateOfBirth=" + customerDateOfBirth
321
				+ ", customerAddress1=" + customerAddress1 + ", customerAddress2=" + customerAddress2
322
				+ ", customerCity=" + customerCity + ", customerPinCode=" + customerPinCode + ", customerState="
323
				+ customerState + ", createTimestamp=" + createTimestamp + ", invoiceCreationTimestamp="
23269 ashik.ali 324
				+ invoiceCreationTimestamp + "]";
22216 ashik.ali 325
	}
326
 
22243 ashik.ali 327
 
22216 ashik.ali 328
}