Subversion Repositories SmartDukaan

Rev

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