Subversion Repositories SmartDukaan

Rev

Rev 29811 | Rev 30219 | Go to most recent revision | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed

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

import java.io.Serializable;
import java.time.LocalDateTime;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import com.spice.profitmandi.dao.enumuration.fofo.Gateway;

@Entity
@Table(name = "dtr.credit_account", schema = "dtr")
public class CreditAccount implements Serializable {

        private static final long serialVersionUID = 1L;

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

        public int getId() {
                return id;
        }

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

        @Column(name = "fofo_id", unique = true, updatable = false)
        private int fofoId;

        @Enumerated(EnumType.STRING)
        private Gateway gateway;

        @Column
        private float sanctionedAmount;

        @Column
        private float availableAmount;

        @Column
        private float interestRate;

        @Column
        @Enumerated(EnumType.STRING)
        private CreditStatus creditStatus;

        @Column
        LocalDateTime updatedOn;

        @Column
        private boolean active;

        @Column
        private String description;

        public boolean isActive() {
                return active;
        }

        public void setActive(boolean active) {
                this.active = active;
        }

        public String getDescription() {
                return description;
        }

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

        public CreditStatus getCreditStatus() {
                return creditStatus;
        }

        public void setCreditStatus(CreditStatus creditStatus) {
                this.creditStatus = creditStatus;
        }

        public LocalDateTime getUpdatedOn() {
                return updatedOn;
        }

        public void setUpdatedOn(LocalDateTime updatedOn) {
                this.updatedOn = updatedOn;
        }

        public int getFofoId() {
                return fofoId;
        }

        public void setFofoId(int fofoId) {
                this.fofoId = fofoId;
        }

        public Gateway getGateway() {
                return gateway;
        }

        public void setGateway(Gateway gateway) {
                this.gateway = gateway;
        }

        public float getSanctionedAmount() {
                return sanctionedAmount;
        }

        public void setSanctionedAmount(float sanctionedAmount) {
                this.sanctionedAmount = sanctionedAmount;
        }

        public float getAvailableAmount() {
                return availableAmount;
        }

        public void setAvailableAmount(float availableAmount) {
                this.availableAmount = availableAmount;
        }

        public float getInterestRate() {
                return interestRate;
        }

        public void setInterestRate(float interestRate) {
                this.interestRate = interestRate;
        }

        @Override
        public int hashCode() {
                final int prime = 31;
                int result = 1;
                result = prime * result + (active ? 1231 : 1237);
                result = prime * result + Float.floatToIntBits(availableAmount);
                result = prime * result + ((creditStatus == null) ? 0 : creditStatus.hashCode());
                result = prime * result + ((description == null) ? 0 : description.hashCode());
                result = prime * result + fofoId;
                result = prime * result + ((gateway == null) ? 0 : gateway.hashCode());
                result = prime * result + id;
                result = prime * result + Float.floatToIntBits(interestRate);
                result = prime * result + Float.floatToIntBits(sanctionedAmount);
                result = prime * result + ((updatedOn == null) ? 0 : updatedOn.hashCode());
                return result;
        }

        @Override
        public boolean equals(Object obj) {
                if (this == obj)
                        return true;
                if (obj == null)
                        return false;
                if (getClass() != obj.getClass())
                        return false;
                CreditAccount other = (CreditAccount) obj;
                if (active != other.active)
                        return false;
                if (Float.floatToIntBits(availableAmount) != Float.floatToIntBits(other.availableAmount))
                        return false;
                if (creditStatus != other.creditStatus)
                        return false;
                if (description == null) {
                        if (other.description != null)
                                return false;
                } else if (!description.equals(other.description))
                        return false;
                if (fofoId != other.fofoId)
                        return false;
                if (gateway != other.gateway)
                        return false;
                if (id != other.id)
                        return false;
                if (Float.floatToIntBits(interestRate) != Float.floatToIntBits(other.interestRate))
                        return false;
                if (Float.floatToIntBits(sanctionedAmount) != Float.floatToIntBits(other.sanctionedAmount))
                        return false;
                if (updatedOn == null) {
                        if (other.updatedOn != null)
                                return false;
                } else if (!updatedOn.equals(other.updatedOn))
                        return false;
                return true;
        }

        @Override
        public String toString() {
                return "CreditAccount [id=" + id + ", fofoId=" + fofoId + ", gateway=" + gateway + ", sanctionedAmount="
                                + sanctionedAmount + ", availableAmount=" + availableAmount + ", interestRate=" + interestRate
                                + ", creditStatus=" + creditStatus + ", updatedOn=" + updatedOn + ", active=" + active
                                + ", description=" + description + "]";
        }

}