Advertisement
lesharb

TransferLog

Aug 11th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5.10 KB | None | 0 0
  1. package by.model.entity;
  2.  
  3. import lombok.Data;
  4.  
  5. import javax.persistence.*;
  6. import java.math.BigDecimal;
  7. import java.util.Date;
  8.  
  9. @Entity(name = "TransferLog")
  10. @Table(name = "TRANSFER_LOG")
  11. @Data
  12. public class TransferLog {
  13.  
  14.     @Id
  15.     @GeneratedValue(generator = "TRANSFER_LOG_SEQ", strategy = GenerationType.SEQUENCE)
  16.     @SequenceGenerator(name = "TRANSFER_LOG_SEQ", sequenceName = "TRANSFER_LOG_SEQ", allocationSize = 1)
  17.     @Column(name = "ID", updatable = false, nullable = false)
  18.     private Long id;
  19.  
  20.     @Temporal(TemporalType.TIMESTAMP)
  21.     @Column(name = "TRANSACTION", updatable = false, nullable = false)
  22.     private Date transaction;
  23.  
  24.     @Column(name = "ORDER_ID", length = 64)
  25.     private String orderId;
  26.  
  27.     @Column(name = "AMOUNT", nullable = false)
  28.     private BigDecimal amount;
  29.  
  30.     @Column(name = "CURRENCY", nullable = false)
  31.     private Integer currency;
  32.  
  33.     @ManyToOne(fetch = FetchType.LAZY)
  34.     @JoinColumn(name = "USER_ID", referencedColumnName = "ID", nullable = false)
  35.     private UserInfo userInfo;
  36.  
  37.     @ManyToOne(fetch = FetchType.LAZY)
  38.     @JoinColumn(name = "STATUS", referencedColumnName = "ID", nullable = false)
  39.     private TransferStatus transferStatus;
  40.  
  41.     @Column(name = "PAN", length = 19)
  42.     private String pan;
  43.  
  44.     @Column(name = "P2PPAN", length = 19)
  45.     private String p2ppan;
  46.  
  47.     @Column(name = "EMAIL", length = 128)
  48.     private String email;
  49.  
  50.     @Column(name = "APPROVALCODE", length = 6)
  51.     private String approvalCode;
  52.  
  53.     @Temporal(TemporalType.TIMESTAMP)
  54.     @Column(name = "TRANSACTION_END")
  55.     private Date transactionEnd;
  56.  
  57.     @Column(name = "COMMISSION")
  58.     private BigDecimal commission;
  59.  
  60.     @Column(name = "TYPE_OF_TRANSFER")
  61.     private String typeOfTransfer;
  62.  
  63.     @Column(name = "ERRORMESSAGE")
  64.     private String errorMessage;
  65.  
  66.     @Column(name = "CARDHOLDERNAME")
  67.     private String cardholderName;
  68.  
  69.     @Column(name = "SEND_EMAIL", nullable = false)
  70.     private Integer sendEmail;
  71.  
  72.     @Override
  73.     public boolean equals(Object obj) {
  74.         if (obj == null)
  75.             return false;
  76.         if (!TransferLog.class.isAssignableFrom(obj.getClass()))
  77.             return false;
  78.         final TransferLog other = (TransferLog) obj;
  79.  
  80.         if ((this.id == null) ? (other.id != null) : !this.id.equals(other.id))
  81.             return false;
  82.         if ((this.transaction == null) ? (other.transaction != null) : !this.transaction.equals(other.transaction))
  83.             return false;
  84.         if ((this.orderId == null) ? (other.orderId != null) : !this.orderId.equals(other.orderId))
  85.             return false;
  86.         if ((this.amount == null) ? (other.amount != null) : !this.amount.equals(other.amount))
  87.             return false;
  88.         if ((this.currency == null) ? (other.currency != null) : !this.currency.equals(other.currency))
  89.             return false;
  90.         if ((this.pan == null) ? (other.pan != null) : !this.pan.equals(other.pan))
  91.             return false;
  92.         if ((this.p2ppan == null) ? (other.p2ppan != null) : !this.p2ppan.equals(other.p2ppan))
  93.             return false;
  94.         if ((this.email == null) ? (other.email != null) : !this.email.equals(other.email))
  95.             return false;
  96.         if ((this.approvalCode == null) ? (other.approvalCode != null) : !this.approvalCode.equals(other.approvalCode))
  97.             return false;
  98.         if ((this.transactionEnd == null) ? (other.transactionEnd != null) : !this.transactionEnd.equals(other.transactionEnd))
  99.             return false;
  100.         if ((this.commission == null) ? (other.commission != null) : !this.commission.equals(other.commission))
  101.             return false;
  102.         if ((this.typeOfTransfer == null) ? (other.typeOfTransfer != null) : !this.typeOfTransfer.equals(other.typeOfTransfer))
  103.             return false;
  104.         if ((this.errorMessage == null) ? (other.errorMessage != null) : !this.errorMessage.equals(other.errorMessage))
  105.             return false;
  106.         if ((this.cardholderName == null) ? (other.cardholderName != null) : !this.cardholderName.equals(other.cardholderName))
  107.             return false;
  108.         if ((this.sendEmail == null) ? (other.sendEmail != null) : !this.sendEmail.equals(other.sendEmail))
  109.             return false;
  110.  
  111.         return true;
  112.     }
  113.  
  114.     @Override
  115.     public int hashCode() {
  116.         int hash = 3;
  117.         hash = 53 * hash + (this.id != null ? this.id.hashCode() : 0);
  118.         hash = 53 * hash + (this.transaction != null ? this.transaction.hashCode() : 0);
  119.         hash = 53 * hash + (this.orderId != null ? this.orderId.hashCode() : 0);
  120.         hash = 53 * hash + (this.amount != null ? this.amount.hashCode() : 0);
  121.         hash = 53 * hash + (this.currency != null ? this.currency.hashCode() : 0);
  122.         hash = 53 * hash + (this.pan != null ? this.pan.hashCode() : 0);
  123.         hash = 53 * hash + (this.p2ppan != null ? this.p2ppan.hashCode() : 0);
  124.         hash = 53 * hash + (this.email != null ? this.email.hashCode() : 0);
  125.         hash = 53 * hash + (this.approvalCode != null ? this.approvalCode.hashCode() : 0);
  126.         hash = 53 * hash + (this.transactionEnd != null ? this.transactionEnd.hashCode() : 0);
  127.         hash = 53 * hash + (this.commission != null ? this.commission.hashCode() : 0);
  128.         hash = 53 * hash + (this.typeOfTransfer != null ? this.typeOfTransfer.hashCode() : 0);
  129.         hash = 53 * hash + (this.errorMessage != null ? this.errorMessage.hashCode() : 0);
  130.         hash = 53 * hash + (this.cardholderName != null ? this.cardholderName.hashCode() : 0);
  131.         hash = 53 * hash + (this.sendEmail != null ? this.sendEmail.hashCode() : 0);
  132.         return hash;
  133.     }
  134. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement