| Line 1... |
Line 1... |
| 1 |
package com.spice.profitmandi.dao.entity.dtr;
|
1 |
package com.spice.profitmandi.dao.entity.dtr;
|
| 2 |
|
2 |
|
| - |
|
3 |
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
|
| - |
|
4 |
|
| - |
|
5 |
import javax.persistence.*;
|
| 3 |
import java.io.Serializable;
|
6 |
import java.io.Serializable;
|
| 4 |
import java.time.LocalDate;
|
7 |
import java.time.LocalDate;
|
| 5 |
import java.time.LocalDateTime;
|
8 |
import java.time.LocalDateTime;
|
| 6 |
import java.time.format.DateTimeFormatter;
|
9 |
import java.time.format.DateTimeFormatter;
|
| 7 |
|
- |
|
| 8 |
import javax.persistence.Column;
|
- |
|
| 9 |
import javax.persistence.Convert;
|
- |
|
| 10 |
import javax.persistence.Entity;
|
- |
|
| 11 |
import javax.persistence.GeneratedValue;
|
- |
|
| 12 |
import javax.persistence.GenerationType;
|
- |
|
| 13 |
import javax.persistence.Id;
|
10 |
import java.util.Objects;
|
| 14 |
import javax.persistence.Table;
|
- |
|
| 15 |
import javax.persistence.Transient;
|
- |
|
| 16 |
|
- |
|
| 17 |
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
|
- |
|
| 18 |
|
11 |
|
| 19 |
/**
|
12 |
/**
|
| 20 |
* This class basically contains insurance details
|
13 |
* This class basically contains insurance details
|
| 21 |
*
|
14 |
*
|
| 22 |
* @author ashikali
|
15 |
* @author ashikali
|
| Line 72... |
Line 65... |
| 72 |
private String brand;
|
65 |
private String brand;
|
| 73 |
|
66 |
|
| 74 |
@Column(name = "policy_number")
|
67 |
@Column(name = "policy_number")
|
| 75 |
private String policyNumber;
|
68 |
private String policyNumber;
|
| 76 |
|
69 |
|
| - |
|
70 |
@Column(name = "policy_plan")
|
| - |
|
71 |
private String policyPlan;
|
| - |
|
72 |
|
| 77 |
@Column(name = "provider_id")
|
73 |
@Column(name = "provider_id")
|
| 78 |
private int providerId;
|
74 |
private int providerId;
|
| 79 |
|
75 |
|
| 80 |
@Column(name = "customer_first_name")
|
76 |
@Column(name = "customer_first_name")
|
| 81 |
private String customerFirstName;
|
77 |
private String customerFirstName;
|
| Line 371... |
Line 367... |
| 371 |
|
367 |
|
| 372 |
public void setInvoiceCreationTimestamp(LocalDateTime invoiceCreationTimestamp) {
|
368 |
public void setInvoiceCreationTimestamp(LocalDateTime invoiceCreationTimestamp) {
|
| 373 |
this.invoiceCreationTimestamp = invoiceCreationTimestamp;
|
369 |
this.invoiceCreationTimestamp = invoiceCreationTimestamp;
|
| 374 |
}
|
370 |
}
|
| 375 |
|
371 |
|
| - |
|
372 |
public String getPolicyPlan() {
|
| - |
|
373 |
return policyPlan;
|
| - |
|
374 |
}
|
| - |
|
375 |
|
| - |
|
376 |
public void setPolicyPlan(String policyPlan) {
|
| - |
|
377 |
this.policyPlan = policyPlan;
|
| - |
|
378 |
}
|
| - |
|
379 |
|
| 376 |
@Override
|
380 |
@Override
|
| 377 |
public int hashCode() {
|
381 |
public boolean equals(Object o) {
|
| 378 |
final int prime = 31;
|
- |
|
| 379 |
int result = 1;
|
- |
|
| 380 |
result = prime * result + ((brand == null) ? 0 : brand.hashCode());
|
- |
|
| 381 |
result = prime * result + brandId;
|
- |
|
| 382 |
result = prime * result + ((color == null) ? 0 : color.hashCode());
|
- |
|
| 383 |
result = prime * result + ((coveragePeriod == null) ? 0 : coveragePeriod.hashCode());
|
- |
|
| 384 |
result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
|
- |
|
| 385 |
result = prime * result + ((customerAddress1 == null) ? 0 : customerAddress1.hashCode());
|
- |
|
| 386 |
result = prime * result + ((customerAddress2 == null) ? 0 : customerAddress2.hashCode());
|
- |
|
| 387 |
result = prime * result + ((customerCity == null) ? 0 : customerCity.hashCode());
|
- |
|
| 388 |
result = prime * result + ((customerDateOfBirth == null) ? 0 : customerDateOfBirth.hashCode());
|
- |
|
| 389 |
result = prime * result + ((customerEmailId == null) ? 0 : customerEmailId.hashCode());
|
- |
|
| 390 |
result = prime * result + ((customerFirstName == null) ? 0 : customerFirstName.hashCode());
|
- |
|
| 391 |
result = prime * result + ((customerLastName == null) ? 0 : customerLastName.hashCode());
|
- |
|
| 392 |
result = prime * result + ((customerMobileNumber == null) ? 0 : customerMobileNumber.hashCode());
|
- |
|
| 393 |
result = prime * result + ((customerPinCode == null) ? 0 : customerPinCode.hashCode());
|
- |
|
| 394 |
result = prime * result + ((customerState == null) ? 0 : customerState.hashCode());
|
- |
|
| 395 |
result = prime * result + ((deviceInvoiceNumber == null) ? 0 : deviceInvoiceNumber.hashCode());
|
- |
|
| 396 |
result = prime * result + id;
|
382 |
if (this == o) return true;
|
| 397 |
result = prime * result + ((insuranceProvider == null) ? 0 : insuranceProvider.hashCode());
|
- |
|
| 398 |
result = prime * result + ((invoiceCreationTimestamp == null) ? 0 : invoiceCreationTimestamp.hashCode());
|
- |
|
| 399 |
result = prime * result + ((invoiceNumber == null) ? 0 : invoiceNumber.hashCode());
|
- |
|
| 400 |
result = prime * result + ((modelName == null) ? 0 : modelName.hashCode());
|
- |
|
| 401 |
result = prime * result + ((policyNumber == null) ? 0 : policyNumber.hashCode());
|
- |
|
| 402 |
result = prime * result + (posted ? 1231 : 1237);
|
383 |
if (o == null || getClass() != o.getClass()) return false;
|
| 403 |
result = prime * result + ((productName == null) ? 0 : productName.hashCode());
|
- |
|
| 404 |
result = prime * result + providerId;
|
384 |
InsurancePolicy that = (InsurancePolicy) o;
|
| 405 |
result = prime * result + Float.floatToIntBits(purchaseAmount);
|
- |
|
| 406 |
result = prime * result + retailerId;
|
- |
|
| 407 |
result = prime * result + Float.floatToIntBits(saleAmount);
|
- |
|
| 408 |
result = prime * result + Float.floatToIntBits(sellingPrice);
|
- |
|
| 409 |
result = prime * result + ((serialNumber == null) ? 0 : serialNumber.hashCode());
|
- |
|
| 410 |
return result;
|
385 |
return id == that.id && retailerId == that.retailerId && Float.compare(that.purchaseAmount, purchaseAmount) == 0 && Float.compare(that.saleAmount, saleAmount) == 0 && Float.compare(that.sellingPrice, sellingPrice) == 0 && policyPlan == that.policyPlan && providerId == that.providerId && posted == that.posted && brandId == that.brandId && Objects.equals(invoiceNumber, that.invoiceNumber) && Objects.equals(productName, that.productName) && Objects.equals(serialNumber, that.serialNumber) && Objects.equals(modelName, that.modelName) && Objects.equals(brand, that.brand) && Objects.equals(policyNumber, that.policyNumber) && Objects.equals(customerFirstName, that.customerFirstName) && Objects.equals(customerLastName, that.customerLastName) && Objects.equals(customerMobileNumber, that.customerMobileNumber) && Objects.equals(customerEmailId, that.customerEmailId) && Objects.equals(customerDateOfBirth, that.customerDateOfBirth) && Objects.equals(customerAddress1, that.customerAddress1) && Objects.equals(customerAddress2, that.customerAddress2) && Objects.equals(customerCity, that.customerCity) && Objects.equals(customerPinCode, that.customerPinCode) && Objects.equals(customerState, that.customerState) && Objects.equals(deviceInvoiceNumber, that.deviceInvoiceNumber) && Objects.equals(insuranceProvider, that.insuranceProvider) && Objects.equals(createTimestamp, that.createTimestamp) && Objects.equals(invoiceCreationTimestamp, that.invoiceCreationTimestamp) && Objects.equals(color, that.color) && Objects.equals(coveragePeriod, that.coveragePeriod);
|
| 411 |
}
|
386 |
}
|
| 412 |
|
387 |
|
| 413 |
@Override
|
388 |
@Override
|
| 414 |
public boolean equals(Object obj) {
|
389 |
public int hashCode() {
|
| 415 |
if (this == obj)
|
- |
|
| 416 |
return true;
|
- |
|
| 417 |
if (obj == null)
|
- |
|
| 418 |
return false;
|
- |
|
| 419 |
if (getClass() != obj.getClass())
|
- |
|
| 420 |
return false;
|
- |
|
| 421 |
InsurancePolicy other = (InsurancePolicy) obj;
|
- |
|
| 422 |
if (brand == null) {
|
- |
|
| 423 |
if (other.brand != null)
|
- |
|
| 424 |
return false;
|
- |
|
| 425 |
} else if (!brand.equals(other.brand))
|
- |
|
| 426 |
return false;
|
- |
|
| 427 |
if (brandId != other.brandId)
|
- |
|
| 428 |
return false;
|
- |
|
| 429 |
if (color == null) {
|
- |
|
| 430 |
if (other.color != null)
|
- |
|
| 431 |
return false;
|
- |
|
| 432 |
} else if (!color.equals(other.color))
|
- |
|
| 433 |
return false;
|
- |
|
| 434 |
if (coveragePeriod == null) {
|
- |
|
| 435 |
if (other.coveragePeriod != null)
|
- |
|
| 436 |
return false;
|
- |
|
| 437 |
} else if (!coveragePeriod.equals(other.coveragePeriod))
|
- |
|
| 438 |
return false;
|
- |
|
| 439 |
if (createTimestamp == null) {
|
- |
|
| 440 |
if (other.createTimestamp != null)
|
- |
|
| 441 |
return false;
|
- |
|
| 442 |
} else if (!createTimestamp.equals(other.createTimestamp))
|
- |
|
| 443 |
return false;
|
- |
|
| 444 |
if (customerAddress1 == null) {
|
- |
|
| 445 |
if (other.customerAddress1 != null)
|
- |
|
| 446 |
return false;
|
- |
|
| 447 |
} else if (!customerAddress1.equals(other.customerAddress1))
|
- |
|
| 448 |
return false;
|
- |
|
| 449 |
if (customerAddress2 == null) {
|
- |
|
| 450 |
if (other.customerAddress2 != null)
|
- |
|
| 451 |
return false;
|
- |
|
| 452 |
} else if (!customerAddress2.equals(other.customerAddress2))
|
- |
|
| 453 |
return false;
|
- |
|
| 454 |
if (customerCity == null) {
|
- |
|
| 455 |
if (other.customerCity != null)
|
- |
|
| 456 |
return false;
|
- |
|
| 457 |
} else if (!customerCity.equals(other.customerCity))
|
- |
|
| 458 |
return false;
|
- |
|
| 459 |
if (customerDateOfBirth == null) {
|
- |
|
| 460 |
if (other.customerDateOfBirth != null)
|
- |
|
| 461 |
return false;
|
- |
|
| 462 |
} else if (!customerDateOfBirth.equals(other.customerDateOfBirth))
|
- |
|
| 463 |
return false;
|
- |
|
| 464 |
if (customerEmailId == null) {
|
- |
|
| 465 |
if (other.customerEmailId != null)
|
- |
|
| 466 |
return false;
|
- |
|
| 467 |
} else if (!customerEmailId.equals(other.customerEmailId))
|
- |
|
| 468 |
return false;
|
- |
|
| 469 |
if (customerFirstName == null) {
|
- |
|
| 470 |
if (other.customerFirstName != null)
|
- |
|
| 471 |
return false;
|
- |
|
| 472 |
} else if (!customerFirstName.equals(other.customerFirstName))
|
- |
|
| 473 |
return false;
|
- |
|
| 474 |
if (customerLastName == null) {
|
- |
|
| 475 |
if (other.customerLastName != null)
|
- |
|
| 476 |
return false;
|
- |
|
| 477 |
} else if (!customerLastName.equals(other.customerLastName))
|
- |
|
| 478 |
return false;
|
- |
|
| 479 |
if (customerMobileNumber == null) {
|
- |
|
| 480 |
if (other.customerMobileNumber != null)
|
- |
|
| 481 |
return false;
|
- |
|
| 482 |
} else if (!customerMobileNumber.equals(other.customerMobileNumber))
|
- |
|
| 483 |
return false;
|
- |
|
| 484 |
if (customerPinCode == null) {
|
- |
|
| 485 |
if (other.customerPinCode != null)
|
- |
|
| 486 |
return false;
|
- |
|
| 487 |
} else if (!customerPinCode.equals(other.customerPinCode))
|
- |
|
| 488 |
return false;
|
- |
|
| 489 |
if (customerState == null) {
|
- |
|
| 490 |
if (other.customerState != null)
|
- |
|
| 491 |
return false;
|
- |
|
| 492 |
} else if (!customerState.equals(other.customerState))
|
- |
|
| 493 |
return false;
|
- |
|
| 494 |
if (deviceInvoiceNumber == null) {
|
- |
|
| 495 |
if (other.deviceInvoiceNumber != null)
|
- |
|
| 496 |
return false;
|
- |
|
| 497 |
} else if (!deviceInvoiceNumber.equals(other.deviceInvoiceNumber))
|
- |
|
| 498 |
return false;
|
- |
|
| 499 |
if (id != other.id)
|
- |
|
| 500 |
return false;
|
- |
|
| 501 |
if (insuranceProvider == null) {
|
- |
|
| 502 |
if (other.insuranceProvider != null)
|
- |
|
| 503 |
return false;
|
- |
|
| 504 |
} else if (!insuranceProvider.equals(other.insuranceProvider))
|
- |
|
| 505 |
return false;
|
- |
|
| 506 |
if (invoiceCreationTimestamp == null) {
|
- |
|
| 507 |
if (other.invoiceCreationTimestamp != null)
|
- |
|
| 508 |
return false;
|
- |
|
| 509 |
} else if (!invoiceCreationTimestamp.equals(other.invoiceCreationTimestamp))
|
- |
|
| 510 |
return false;
|
- |
|
| 511 |
if (invoiceNumber == null) {
|
- |
|
| 512 |
if (other.invoiceNumber != null)
|
- |
|
| 513 |
return false;
|
- |
|
| 514 |
} else if (!invoiceNumber.equals(other.invoiceNumber))
|
- |
|
| 515 |
return false;
|
- |
|
| 516 |
if (modelName == null) {
|
- |
|
| 517 |
if (other.modelName != null)
|
- |
|
| 518 |
return false;
|
- |
|
| 519 |
} else if (!modelName.equals(other.modelName))
|
- |
|
| 520 |
return false;
|
- |
|
| 521 |
if (policyNumber == null) {
|
- |
|
| 522 |
if (other.policyNumber != null)
|
- |
|
| 523 |
return false;
|
- |
|
| 524 |
} else if (!policyNumber.equals(other.policyNumber))
|
- |
|
| 525 |
return false;
|
- |
|
| 526 |
if (posted != other.posted)
|
- |
|
| 527 |
return false;
|
- |
|
| 528 |
if (productName == null) {
|
- |
|
| 529 |
if (other.productName != null)
|
- |
|
| 530 |
return false;
|
- |
|
| 531 |
} else if (!productName.equals(other.productName))
|
- |
|
| 532 |
return false;
|
- |
|
| 533 |
if (providerId != other.providerId)
|
- |
|
| 534 |
return false;
|
- |
|
| 535 |
if (Float.floatToIntBits(purchaseAmount) != Float.floatToIntBits(other.purchaseAmount))
|
390 |
return Objects.hash(id, invoiceNumber, retailerId, purchaseAmount, saleAmount, sellingPrice, productName, serialNumber, modelName, brand, policyNumber, policyPlan, providerId, customerFirstName, customerLastName, customerMobileNumber, customerEmailId, customerDateOfBirth, customerAddress1, customerAddress2, customerCity, customerPinCode, customerState, deviceInvoiceNumber, posted, insuranceProvider, createTimestamp, invoiceCreationTimestamp, color, coveragePeriod, brandId);
|
| 536 |
return false;
|
- |
|
| 537 |
if (retailerId != other.retailerId)
|
- |
|
| 538 |
return false;
|
- |
|
| 539 |
if (Float.floatToIntBits(saleAmount) != Float.floatToIntBits(other.saleAmount))
|
- |
|
| 540 |
return false;
|
- |
|
| 541 |
if (Float.floatToIntBits(sellingPrice) != Float.floatToIntBits(other.sellingPrice))
|
- |
|
| 542 |
return false;
|
- |
|
| 543 |
if (serialNumber == null) {
|
- |
|
| 544 |
if (other.serialNumber != null)
|
- |
|
| 545 |
return false;
|
- |
|
| 546 |
} else if (!serialNumber.equals(other.serialNumber))
|
- |
|
| 547 |
return false;
|
- |
|
| 548 |
return true;
|
- |
|
| 549 |
}
|
391 |
}
|
| 550 |
|
392 |
|
| 551 |
@Override
|
393 |
@Override
|
| 552 |
public String toString() {
|
394 |
public String toString() {
|
| 553 |
return "InsurancePolicy [id=" + id + ", invoiceNumber=" + invoiceNumber + ", retailerId=" + retailerId
|
395 |
return "InsurancePolicy [id=" + id + ", invoiceNumber=" + invoiceNumber + ", retailerId=" + retailerId
|