| 22216 |
ashik.ali |
1 |
package com.spice.profitmandi.dao.entity.dtr;
|
|
|
2 |
|
|
|
3 |
import java.io.Serializable;
|
|
|
4 |
import java.time.LocalDateTime;
|
|
|
5 |
|
|
|
6 |
import javax.persistence.Column;
|
|
|
7 |
import javax.persistence.Convert;
|
|
|
8 |
import javax.persistence.Entity;
|
|
|
9 |
import javax.persistence.GeneratedValue;
|
|
|
10 |
import javax.persistence.GenerationType;
|
|
|
11 |
import javax.persistence.Id;
|
|
|
12 |
import javax.persistence.Table;
|
|
|
13 |
|
|
|
14 |
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
|
|
|
15 |
|
|
|
16 |
/**
|
|
|
17 |
* This class basically contains insurance details
|
|
|
18 |
*
|
|
|
19 |
* @author ashikali
|
|
|
20 |
*
|
|
|
21 |
*/
|
|
|
22 |
@Entity
|
|
|
23 |
@Table(name="dtr.insurance_policy", schema = "dtr")
|
|
|
24 |
public class InsurancePolicy implements Serializable{
|
|
|
25 |
|
|
|
26 |
private static final long serialVersionUID = 1L;
|
|
|
27 |
|
|
|
28 |
public InsurancePolicy() {
|
|
|
29 |
}
|
|
|
30 |
|
|
|
31 |
@Id
|
|
|
32 |
@Column(name="id", unique=true, updatable=false)
|
|
|
33 |
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
|
34 |
private int id;
|
|
|
35 |
|
|
|
36 |
@Column(name = "invoice_number")
|
|
|
37 |
private String invoiceNumber;
|
|
|
38 |
|
|
|
39 |
@Column(name="retailer_id")
|
|
|
40 |
private int retailerId;
|
|
|
41 |
|
|
|
42 |
@Column(name= "purchase_amount")
|
|
|
43 |
private float purchaseAmount;
|
|
|
44 |
|
|
|
45 |
@Column(name= "sale_amount")
|
|
|
46 |
private float saleAmount;
|
|
|
47 |
|
|
|
48 |
@Column(name= "selling_price")
|
|
|
49 |
private float sellingPrice;
|
|
|
50 |
|
|
|
51 |
@Column(name = "serial_number", unique = true)
|
|
|
52 |
private String serialNumber;
|
|
|
53 |
|
|
|
54 |
@Column(name = "model_name")
|
|
|
55 |
private String modelName;
|
|
|
56 |
|
|
|
57 |
@Column(name = "brand")
|
|
|
58 |
private String brand;
|
|
|
59 |
|
|
|
60 |
@Column(name = "policy_number")
|
|
|
61 |
private String policyNumber;
|
|
|
62 |
|
|
|
63 |
@Column(name="provider_id")
|
|
|
64 |
private int providerId;
|
|
|
65 |
|
|
|
66 |
@Convert(converter = LocalDateTimeAttributeConverter.class)
|
|
|
67 |
@Column(name="create_timestamp", updatable = false)
|
|
|
68 |
private LocalDateTime createTimestamp = LocalDateTime.now();
|
|
|
69 |
|
|
|
70 |
@Convert(converter = LocalDateTimeAttributeConverter.class)
|
|
|
71 |
@Column(name="invoice_creation_timestamp")
|
|
|
72 |
private LocalDateTime invoiceCreationTimestamp = LocalDateTime.now();
|
|
|
73 |
|
|
|
74 |
public int getId() {
|
|
|
75 |
return id;
|
|
|
76 |
}
|
|
|
77 |
|
|
|
78 |
public void setId(int id) {
|
|
|
79 |
this.id = id;
|
|
|
80 |
}
|
|
|
81 |
|
|
|
82 |
public String getInvoiceNumber() {
|
|
|
83 |
return invoiceNumber;
|
|
|
84 |
}
|
|
|
85 |
public void setInvoiceNumber(String invoiceNumber) {
|
|
|
86 |
this.invoiceNumber = invoiceNumber;
|
|
|
87 |
}
|
|
|
88 |
|
|
|
89 |
public int getRetailerId() {
|
|
|
90 |
return retailerId;
|
|
|
91 |
}
|
|
|
92 |
|
|
|
93 |
public void setRetailerId(int retailerId) {
|
|
|
94 |
this.retailerId = retailerId;
|
|
|
95 |
}
|
|
|
96 |
|
|
|
97 |
public float getPurchaseAmount() {
|
|
|
98 |
return purchaseAmount;
|
|
|
99 |
}
|
|
|
100 |
|
|
|
101 |
public void setPurchaseAmount(float purchaseAmount) {
|
|
|
102 |
this.purchaseAmount = purchaseAmount;
|
|
|
103 |
}
|
|
|
104 |
|
|
|
105 |
public float getSaleAmount() {
|
|
|
106 |
return saleAmount;
|
|
|
107 |
}
|
|
|
108 |
|
|
|
109 |
public void setSaleAmount(float saleAmount) {
|
|
|
110 |
this.saleAmount = saleAmount;
|
|
|
111 |
}
|
|
|
112 |
|
|
|
113 |
public float getSellingPrice() {
|
|
|
114 |
return sellingPrice;
|
|
|
115 |
}
|
|
|
116 |
|
|
|
117 |
public void setSellingPrice(float sellingPrice) {
|
|
|
118 |
this.sellingPrice = sellingPrice;
|
|
|
119 |
}
|
|
|
120 |
|
|
|
121 |
public String getSerialNumber() {
|
|
|
122 |
return serialNumber;
|
|
|
123 |
}
|
|
|
124 |
|
|
|
125 |
public void setSerialNumber(String serialNumber) {
|
|
|
126 |
this.serialNumber = serialNumber;
|
|
|
127 |
}
|
|
|
128 |
|
|
|
129 |
public String getModelName() {
|
|
|
130 |
return modelName;
|
|
|
131 |
}
|
|
|
132 |
public void setModelName(String modelName) {
|
|
|
133 |
this.modelName = modelName;
|
|
|
134 |
}
|
|
|
135 |
|
|
|
136 |
public String getBrand() {
|
|
|
137 |
return brand;
|
|
|
138 |
}
|
|
|
139 |
public void setBrand(String brand) {
|
|
|
140 |
this.brand = brand;
|
|
|
141 |
}
|
|
|
142 |
|
|
|
143 |
public String getPolicyNumber() {
|
|
|
144 |
return policyNumber;
|
|
|
145 |
}
|
|
|
146 |
|
|
|
147 |
public void setPolicyNumber(String policyNumber) {
|
|
|
148 |
this.policyNumber = policyNumber;
|
|
|
149 |
}
|
|
|
150 |
|
|
|
151 |
public int getProviderId() {
|
|
|
152 |
return providerId;
|
|
|
153 |
}
|
|
|
154 |
|
|
|
155 |
public void setProviderId(int providerId) {
|
|
|
156 |
this.providerId = providerId;
|
|
|
157 |
}
|
|
|
158 |
|
|
|
159 |
public LocalDateTime getCreateTimestamp() {
|
|
|
160 |
return createTimestamp;
|
|
|
161 |
}
|
|
|
162 |
|
|
|
163 |
public void setCreateTimestamp(LocalDateTime createTimestamp) {
|
|
|
164 |
this.createTimestamp = createTimestamp;
|
|
|
165 |
}
|
|
|
166 |
|
|
|
167 |
public LocalDateTime getInvoiceCreationTimestamp() {
|
|
|
168 |
return invoiceCreationTimestamp;
|
|
|
169 |
}
|
|
|
170 |
|
|
|
171 |
public void setInvoiceCreationTimestamp(LocalDateTime invoiceCreationTimestamp) {
|
|
|
172 |
this.invoiceCreationTimestamp = invoiceCreationTimestamp;
|
|
|
173 |
}
|
|
|
174 |
|
|
|
175 |
|
|
|
176 |
|
|
|
177 |
@Override
|
|
|
178 |
public int hashCode() {
|
|
|
179 |
final int prime = 31;
|
|
|
180 |
int result = 1;
|
|
|
181 |
result = prime * result + id;
|
|
|
182 |
return result;
|
|
|
183 |
}
|
|
|
184 |
|
|
|
185 |
@Override
|
|
|
186 |
public boolean equals(Object obj) {
|
|
|
187 |
if (this == obj)
|
|
|
188 |
return true;
|
|
|
189 |
if (obj == null)
|
|
|
190 |
return false;
|
|
|
191 |
if (getClass() != obj.getClass())
|
|
|
192 |
return false;
|
|
|
193 |
InsurancePolicy other = (InsurancePolicy) obj;
|
|
|
194 |
if (id != other.id)
|
|
|
195 |
return false;
|
|
|
196 |
return true;
|
|
|
197 |
}
|
|
|
198 |
|
|
|
199 |
@Override
|
|
|
200 |
public String toString() {
|
|
|
201 |
return "InsurancePolicy [id=" + id + ", invoiceNumber=" + invoiceNumber + ", retailerId=" + retailerId
|
|
|
202 |
+ ", purchaseAmount=" + purchaseAmount + ", saleAmount=" + saleAmount + ", sellingPrice=" + sellingPrice
|
|
|
203 |
+ ", serialNumber=" + serialNumber + ", modelName=" + modelName + ", brand=" + brand + ", policyNumber="
|
|
|
204 |
+ policyNumber + ", providerId=" + providerId + ", createTimestamp=" + createTimestamp
|
|
|
205 |
+ ", invoiceCreationTimestamp=" + invoiceCreationTimestamp + "]";
|
|
|
206 |
}
|
|
|
207 |
|
|
|
208 |
|
|
|
209 |
|
|
|
210 |
}
|