Subversion Repositories SmartDukaan

Rev

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