Subversion Repositories SmartDukaan

Rev

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