Subversion Repositories SmartDukaan

Rev

Rev 29777 | Rev 29813 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
29777 amit.gupta 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.Entity;
8
import javax.persistence.EnumType;
9
import javax.persistence.Enumerated;
10
import javax.persistence.Id;
11
import javax.persistence.Table;
12
 
13
import com.spice.profitmandi.dao.enumuration.fofo.Gateway;
14
 
15
@Entity
29811 tejbeer 16
@Table(name = "dtr.credit_account", schema = "dtr")
17
public class CreditAccount implements Serializable {
18
 
29777 amit.gupta 19
	private static final long serialVersionUID = 1L;
20
 
21
	@Id
29811 tejbeer 22
	@Column(name = "fofo_id", unique = true, updatable = false)
29777 amit.gupta 23
	private int fofoId;
29811 tejbeer 24
 
29777 amit.gupta 25
	@Id
26
	@Enumerated(EnumType.STRING)
27
	private Gateway gateway;
28
 
29
	@Column
30
	private float sanctionedAmount;
29811 tejbeer 31
 
29777 amit.gupta 32
	@Column
33
	private float availableAmount;
29811 tejbeer 34
 
29777 amit.gupta 35
	@Column
36
	private float interestRate;
29811 tejbeer 37
 
29777 amit.gupta 38
	@Column
39
	@Enumerated(EnumType.STRING)
40
	private CreditStatus creditStatus;
29811 tejbeer 41
 
29777 amit.gupta 42
	@Column
43
	LocalDateTime updatedOn;
29811 tejbeer 44
 
45
	@Column
46
	private boolean active;
47
 
48
	@Column
49
	private String description;
50
 
51
	public boolean isActive() {
52
		return active;
53
	}
54
 
55
	public void setActive(boolean active) {
56
		this.active = active;
57
	}
58
 
59
	public String getDescription() {
60
		return description;
61
	}
62
 
63
	public void setDescription(String description) {
64
		this.description = description;
65
	}
66
 
29777 amit.gupta 67
	public CreditStatus getCreditStatus() {
68
		return creditStatus;
69
	}
70
 
71
	public void setCreditStatus(CreditStatus creditStatus) {
72
		this.creditStatus = creditStatus;
73
	}
74
 
75
	public LocalDateTime getUpdatedOn() {
76
		return updatedOn;
77
	}
78
 
79
	public void setUpdatedOn(LocalDateTime updatedOn) {
80
		this.updatedOn = updatedOn;
81
	}
82
 
83
	public int getFofoId() {
84
		return fofoId;
85
	}
86
 
87
	public void setFofoId(int fofoId) {
88
		this.fofoId = fofoId;
89
	}
90
 
91
	public Gateway getGateway() {
92
		return gateway;
93
	}
94
 
95
	public void setGateway(Gateway gateway) {
96
		this.gateway = gateway;
97
	}
98
 
99
	public float getSanctionedAmount() {
100
		return sanctionedAmount;
101
	}
102
 
103
	public void setSanctionedAmount(float sanctionedAmount) {
104
		this.sanctionedAmount = sanctionedAmount;
105
	}
106
 
107
	public float getAvailableAmount() {
108
		return availableAmount;
109
	}
110
 
111
	public void setAvailableAmount(float availableAmount) {
112
		this.availableAmount = availableAmount;
113
	}
114
 
115
	public float getInterestRate() {
116
		return interestRate;
117
	}
118
 
119
	public void setInterestRate(float interestRate) {
120
		this.interestRate = interestRate;
121
	}
122
 
123
	@Override
124
	public int hashCode() {
125
		final int prime = 31;
126
		int result = 1;
29811 tejbeer 127
		result = prime * result + (active ? 1231 : 1237);
29777 amit.gupta 128
		result = prime * result + Float.floatToIntBits(availableAmount);
129
		result = prime * result + ((creditStatus == null) ? 0 : creditStatus.hashCode());
29811 tejbeer 130
		result = prime * result + ((description == null) ? 0 : description.hashCode());
29777 amit.gupta 131
		result = prime * result + fofoId;
132
		result = prime * result + ((gateway == null) ? 0 : gateway.hashCode());
133
		result = prime * result + Float.floatToIntBits(interestRate);
134
		result = prime * result + Float.floatToIntBits(sanctionedAmount);
135
		result = prime * result + ((updatedOn == null) ? 0 : updatedOn.hashCode());
136
		return result;
137
	}
138
 
139
	@Override
140
	public boolean equals(Object obj) {
141
		if (this == obj)
142
			return true;
143
		if (obj == null)
144
			return false;
145
		if (getClass() != obj.getClass())
146
			return false;
147
		CreditAccount other = (CreditAccount) obj;
29811 tejbeer 148
		if (active != other.active)
149
			return false;
29777 amit.gupta 150
		if (Float.floatToIntBits(availableAmount) != Float.floatToIntBits(other.availableAmount))
151
			return false;
152
		if (creditStatus != other.creditStatus)
153
			return false;
29811 tejbeer 154
		if (description == null) {
155
			if (other.description != null)
156
				return false;
157
		} else if (!description.equals(other.description))
158
			return false;
29777 amit.gupta 159
		if (fofoId != other.fofoId)
160
			return false;
161
		if (gateway != other.gateway)
162
			return false;
163
		if (Float.floatToIntBits(interestRate) != Float.floatToIntBits(other.interestRate))
164
			return false;
165
		if (Float.floatToIntBits(sanctionedAmount) != Float.floatToIntBits(other.sanctionedAmount))
166
			return false;
167
		if (updatedOn == null) {
168
			if (other.updatedOn != null)
169
				return false;
170
		} else if (!updatedOn.equals(other.updatedOn))
171
			return false;
172
		return true;
173
	}
29811 tejbeer 174
 
175
	@Override
176
	public String toString() {
177
		return "CreditAccount [fofoId=" + fofoId + ", gateway=" + gateway + ", sanctionedAmount=" + sanctionedAmount
178
				+ ", availableAmount=" + availableAmount + ", interestRate=" + interestRate + ", creditStatus="
179
				+ creditStatus + ", updatedOn=" + updatedOn + ", active=" + active + ", description=" + description
180
				+ "]";
181
	}
182
 
29777 amit.gupta 183
}