Subversion Repositories SmartDukaan

Rev

Rev 28653 | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed

package com.spice.profitmandi.dao.entity.transaction;

import javax.persistence.*;
import java.time.LocalDateTime;

@Entity
@Table(name = "payment.payment")
public class Payment {

        @Id
        @Column(name = "id", unique = true, updatable = false)
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        private int id;

        @Column
        private int gatewayId;
        @Column
        private String gatewayPaymentId;

        @Column
        private int merchantTxnId;

        @Column
        private String gatewayTxnId;

        @Column
        private double amount;

        @Column
        private String gatewayTxnStatus;

        @Column
        private int status;

        @Column
        private int userId;

        @Column
        private String errorCode;

        @Column
        private String description;

        @Column
        private String authCode;

        @Column
        private String referenceCode;

        @Column
        private String sessionId;

        @Column
        private LocalDateTime gatewayTxnDate;

        @Column
        private LocalDateTime initTimestamp;

        @Column
        private LocalDateTime successTimestamp;

        @Column
        private LocalDateTime errorTimestamp;

        @Column
        private LocalDateTime provisionalCaptureTimestamp;

        @Column
        private boolean isDigital;

        @Column
        private float refundAmount;

        @Override
        public String toString() {
                return "Payment [id=" + id + ", gatewayId=" + gatewayId + ", gatewayPaymentId=" + gatewayPaymentId
                                + ", merchantTxnId=" + merchantTxnId + ", gatewayTxnId=" + gatewayTxnId + ", amount=" + amount
                                + ", gatewayTxnStatus=" + gatewayTxnStatus + ", status=" + status + ", userId=" + userId
                                + ", errorCode=" + errorCode + ", description=" + description + ", authCode=" + authCode
                                + ", referenceCode=" + referenceCode + ", sessionId=" + sessionId + ", gatewayTxnDate=" + gatewayTxnDate
                                + ", initTimestamp=" + initTimestamp + ", successTimestamp=" + successTimestamp + ", errorTimestamp="
                                + errorTimestamp + ", provisionalCaptureTimestamp=" + provisionalCaptureTimestamp + ", isDigital="
                                + isDigital + ", refundAmount=" + refundAmount + "]";
        }

        public int getId() {
                return id;
        }

        public void setId(int id) {
                this.id = id;
        }

        public int getGatewayId() {
                return gatewayId;
        }

        public void setGatewayId(int gatewayId) {
                this.gatewayId = gatewayId;
        }

        public String getGatewayPaymentId() {
                return gatewayPaymentId;
        }

        public void setGatewayPaymentId(String gatewayPaymentId) {
                this.gatewayPaymentId = gatewayPaymentId;
        }

        public int getMerchantTxnId() {
                return merchantTxnId;
        }

        public void setMerchantTxnId(int merchantTxnId) {
                this.merchantTxnId = merchantTxnId;
        }

        public String getGatewayTxnId() {
                return gatewayTxnId;
        }

        public void setGatewayTxnId(String gatewayTxnId) {
                this.gatewayTxnId = gatewayTxnId;
        }

        public double getAmount() {
                return amount;
        }

        public void setAmount(double amount) {
                this.amount = amount;
        }

        public String getGatewayTxnStatus() {
                return gatewayTxnStatus;
        }

        public void setGatewayTxnStatus(String gatewayTxnStatus) {
                this.gatewayTxnStatus = gatewayTxnStatus;
        }

        public int getStatus() {
                return status;
        }

        public void setStatus(int status) {
                this.status = status;
        }

        public int getUserId() {
                return userId;
        }

        public void setUserId(int userId) {
                this.userId = userId;
        }

        public String getErrorCode() {
                return errorCode;
        }

        public void setErrorCode(String errorCode) {
                this.errorCode = errorCode;
        }

        public String getDescription() {
                return description;
        }

        public void setDescription(String description) {
                this.description = description;
        }

        public String getAuthCode() {
                return authCode;
        }

        public void setAuthCode(String authCode) {
                this.authCode = authCode;
        }

        public String getReferenceCode() {
                return referenceCode;
        }

        public void setReferenceCode(String referenceCode) {
                this.referenceCode = referenceCode;
        }

        public String getSessionId() {
                return sessionId;
        }

        public void setSessionId(String sessionId) {
                this.sessionId = sessionId;
        }

        public LocalDateTime getGatewayTxnDate() {
                return gatewayTxnDate;
        }

        public void setGatewayTxnDate(LocalDateTime gatewayTxnDate) {
                this.gatewayTxnDate = gatewayTxnDate;
        }

        public LocalDateTime getInitTimestamp() {
                return initTimestamp;
        }

        public void setInitTimestamp(LocalDateTime initTimestamp) {
                this.initTimestamp = initTimestamp;
        }

        public LocalDateTime getSuccessTimestamp() {
                return successTimestamp;
        }

        public void setSuccessTimestamp(LocalDateTime successTimestamp) {
                this.successTimestamp = successTimestamp;
        }

        public LocalDateTime getErrorTimestamp() {
                return errorTimestamp;
        }

        public void setErrorTimestamp(LocalDateTime errorTimestamp) {
                this.errorTimestamp = errorTimestamp;
        }

        public LocalDateTime getProvisionalCaptureTimestamp() {
                return provisionalCaptureTimestamp;
        }

        public void setProvisionalCaptureTimestamp(LocalDateTime provisionalCaptureTimestamp) {
                this.provisionalCaptureTimestamp = provisionalCaptureTimestamp;
        }

        public boolean isDigital() {
                return isDigital;
        }

        public void setDigital(boolean isDigital) {
                this.isDigital = isDigital;
        }

        public float getRefundAmount() {
                return refundAmount;
        }

        public void setRefundAmount(float refundAmount) {
                this.refundAmount = refundAmount;
        }

        @Override
        public int hashCode() {
                final int prime = 31;
                int result = 1;
                long temp;
                temp = Double.doubleToLongBits(amount);
                result = prime * result + (int) (temp ^ (temp >>> 32));
                result = prime * result + ((authCode == null) ? 0 : authCode.hashCode());
                result = prime * result + ((description == null) ? 0 : description.hashCode());
                result = prime * result + ((errorCode == null) ? 0 : errorCode.hashCode());
                result = prime * result + ((errorTimestamp == null) ? 0 : errorTimestamp.hashCode());
                result = prime * result + gatewayId;
                result = prime * result + ((gatewayPaymentId == null) ? 0 : gatewayPaymentId.hashCode());
                result = prime * result + ((gatewayTxnDate == null) ? 0 : gatewayTxnDate.hashCode());
                result = prime * result + ((gatewayTxnId == null) ? 0 : gatewayTxnId.hashCode());
                result = prime * result + ((gatewayTxnStatus == null) ? 0 : gatewayTxnStatus.hashCode());
                result = prime * result + id;
                result = prime * result + ((initTimestamp == null) ? 0 : initTimestamp.hashCode());
                result = prime * result + (isDigital ? 1231 : 1237);
                result = prime * result + merchantTxnId;
                result = prime * result + ((provisionalCaptureTimestamp == null) ? 0 : provisionalCaptureTimestamp.hashCode());
                result = prime * result + ((referenceCode == null) ? 0 : referenceCode.hashCode());
                result = prime * result + Float.floatToIntBits(refundAmount);
                result = prime * result + ((sessionId == null) ? 0 : sessionId.hashCode());
                result = prime * result + status;
                result = prime * result + ((successTimestamp == null) ? 0 : successTimestamp.hashCode());
                result = prime * result + userId;
                return result;
        }

        @Override
        public boolean equals(Object obj) {
                if (this == obj)
                        return true;
                if (obj == null)
                        return false;
                if (getClass() != obj.getClass())
                        return false;
                Payment other = (Payment) obj;
                if (Double.doubleToLongBits(amount) != Double.doubleToLongBits(other.amount))
                        return false;
                if (authCode == null) {
                        if (other.authCode != null)
                                return false;
                } else if (!authCode.equals(other.authCode))
                        return false;
                if (description == null) {
                        if (other.description != null)
                                return false;
                } else if (!description.equals(other.description))
                        return false;
                if (errorCode == null) {
                        if (other.errorCode != null)
                                return false;
                } else if (!errorCode.equals(other.errorCode))
                        return false;
                if (errorTimestamp == null) {
                        if (other.errorTimestamp != null)
                                return false;
                } else if (!errorTimestamp.equals(other.errorTimestamp))
                        return false;
                if (gatewayId != other.gatewayId)
                        return false;
                if (gatewayPaymentId == null) {
                        if (other.gatewayPaymentId != null)
                                return false;
                } else if (!gatewayPaymentId.equals(other.gatewayPaymentId))
                        return false;
                if (gatewayTxnDate == null) {
                        if (other.gatewayTxnDate != null)
                                return false;
                } else if (!gatewayTxnDate.equals(other.gatewayTxnDate))
                        return false;
                if (gatewayTxnId == null) {
                        if (other.gatewayTxnId != null)
                                return false;
                } else if (!gatewayTxnId.equals(other.gatewayTxnId))
                        return false;
                if (gatewayTxnStatus == null) {
                        if (other.gatewayTxnStatus != null)
                                return false;
                } else if (!gatewayTxnStatus.equals(other.gatewayTxnStatus))
                        return false;
                if (id != other.id)
                        return false;
                if (initTimestamp == null) {
                        if (other.initTimestamp != null)
                                return false;
                } else if (!initTimestamp.equals(other.initTimestamp))
                        return false;
                if (isDigital != other.isDigital)
                        return false;
                if (merchantTxnId != other.merchantTxnId)
                        return false;
                if (provisionalCaptureTimestamp == null) {
                        if (other.provisionalCaptureTimestamp != null)
                                return false;
                } else if (!provisionalCaptureTimestamp.equals(other.provisionalCaptureTimestamp))
                        return false;
                if (referenceCode == null) {
                        if (other.referenceCode != null)
                                return false;
                } else if (!referenceCode.equals(other.referenceCode))
                        return false;
                if (Float.floatToIntBits(refundAmount) != Float.floatToIntBits(other.refundAmount))
                        return false;
                if (sessionId == null) {
                        if (other.sessionId != null)
                                return false;
                } else if (!sessionId.equals(other.sessionId))
                        return false;
                if (status != other.status)
                        return false;
                if (successTimestamp == null) {
                        if (other.successTimestamp != null)
                                return false;
                } else if (!successTimestamp.equals(other.successTimestamp))
                        return false;
                if (userId != other.userId)
                        return false;
                return true;
        }
        
        

}