Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
21714 ashik.ali 1
package com.spice.profitmandi.dao.entity.fofo;
21710 ashik.ali 2
 
3
import java.io.Serializable;
4
import java.time.LocalDateTime;
5
 
6
import javax.persistence.Column;
22009 ashik.ali 7
import javax.persistence.Convert;
21710 ashik.ali 8
import javax.persistence.Entity;
9
import javax.persistence.GeneratedValue;
10
import javax.persistence.GenerationType;
11
import javax.persistence.Id;
12
import javax.persistence.Table;
13
 
22216 ashik.ali 14
import org.hibernate.annotations.UpdateTimestamp;
15
 
22009 ashik.ali 16
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
17
 
21710 ashik.ali 18
/**
19
 * This class basically contains address details
20
 * 
21
 * @author ashikali
22
 *
23
 */
24
@Entity
21895 ashik.ali 25
@Table(name="fofo.customer_address", schema = "fofo")
21710 ashik.ali 26
public class CustomerAddress implements Serializable{
27
 
28
	private static final long serialVersionUID = 1L;
29
 
30
	public CustomerAddress() {
31
	}
32
 
33
	@Id
34
	@Column(name="id", unique=true, updatable=false)
35
	@GeneratedValue(strategy = GenerationType.IDENTITY)
36
	private int id;
37
 
38
	@Column(name="name")
39
	private String name;
40
 
26817 amit.gupta 41
	@Column(name="last_name")
42
	private String lastName;
43
 
21710 ashik.ali 44
	@Column(name = "line_1")
45
	private String line1;
46
 
47
	@Column(name = "line_2")
48
	private String line2;
49
 
50
	@Column(name = "landmark")
51
	private String landmark;
52
 
53
	@Column(name = "city")
54
	private String city;
55
 
56
	@Column(name = "state")
57
	private String state;
58
 
21895 ashik.ali 59
	@Column(name = "pin_code", length = 10)
21710 ashik.ali 60
	private String pinCode;
61
 
62
	@Column(name = "country", length = 100)
63
	private String country;
64
 
21895 ashik.ali 65
	@Column(name = "phone_number", length = 20)
21710 ashik.ali 66
	private String phoneNumber;
67
 
68
	@Column(name = "customer_id")
69
	private int customerId;
70
 
22009 ashik.ali 71
	@Convert(converter = LocalDateTimeAttributeConverter.class)
21710 ashik.ali 72
	@Column(name="create_timestamp", updatable = false)
73
	private LocalDateTime createTimestamp = LocalDateTime.now();
74
 
22009 ashik.ali 75
	@Convert(converter = LocalDateTimeAttributeConverter.class)
21710 ashik.ali 76
	@Column(name="update_timestamp")
22216 ashik.ali 77
	@UpdateTimestamp
21710 ashik.ali 78
	private LocalDateTime updateTimestamp = LocalDateTime.now();
79
 
80
	public int getId() {
81
		return id;
82
	}
83
	public void setId(int id) {
84
		this.id = id;
85
	}
86
	public void setName(String name) {
87
        this.name = name;
88
    }
89
    public String getName() {
90
        return name;
91
    }
92
    public void setLine1(String line1) {
93
		this.line1 = line1;
94
	}
95
    public String getLine1() {
96
		return line1;
97
	}
98
    public void setLine2(String line2) {
99
		this.line2 = line2;
100
	}
101
    public String getLine2() {
102
		return line2;
103
	}
104
    public void setLandmark(String landmark) {
105
		this.landmark = landmark;
106
	}
107
    public String getLandmark() {
108
		return landmark;
109
	}
110
    public void setCity(String city) {
111
		this.city = city;
112
	}
113
    public String getCity() {
114
		return city;
115
	}
116
    public void setPinCode(String pinCode) {
117
		this.pinCode = pinCode;
118
	}
119
    public String getPinCode() {
120
		return pinCode;
121
	}
122
    public void setState(String state) {
123
		this.state = state;
124
	}
125
    public String getState() {
126
		return state;
127
	}
128
    public void setCountry(String country) {
129
		this.country = country;
130
	}
131
    public String getCountry() {
132
		return country;
133
	}
134
    public void setPhoneNumber(String phoneNumber) {
135
		this.phoneNumber = phoneNumber;
136
	}
137
    public String getPhoneNumber() {
138
		return phoneNumber;
139
	}
140
 
141
    public void setCreateTimestamp(LocalDateTime createTimestamp) {
142
		this.createTimestamp = createTimestamp;
143
	}
144
    public LocalDateTime getCreateTimestamp() {
145
		return createTimestamp;
146
	}
147
 
148
    public void setUpdateTimestamp(LocalDateTime updateTimestamp) {
149
		this.updateTimestamp = updateTimestamp;
150
	}
151
    public LocalDateTime getUpdateTimestamp() {
152
		return updateTimestamp;
153
	}
154
 
155
    public int getCustomerId() {
156
		return customerId;
157
	}
158
    public void setCustomerId(int customerId) {
159
		this.customerId = customerId;
160
	}
21924 ashik.ali 161
 
162
 
21710 ashik.ali 163
	@Override
21924 ashik.ali 164
	public int hashCode() {
165
		final int prime = 31;
166
		int result = 1;
26817 amit.gupta 167
		result = prime * result + ((city == null) ? 0 : city.hashCode());
168
		result = prime * result + ((country == null) ? 0 : country.hashCode());
169
		result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
170
		result = prime * result + customerId;
21924 ashik.ali 171
		result = prime * result + id;
26817 amit.gupta 172
		result = prime * result + ((landmark == null) ? 0 : landmark.hashCode());
173
		result = prime * result + ((lastName == null) ? 0 : lastName.hashCode());
174
		result = prime * result + ((line1 == null) ? 0 : line1.hashCode());
175
		result = prime * result + ((line2 == null) ? 0 : line2.hashCode());
176
		result = prime * result + ((name == null) ? 0 : name.hashCode());
177
		result = prime * result + ((phoneNumber == null) ? 0 : phoneNumber.hashCode());
178
		result = prime * result + ((pinCode == null) ? 0 : pinCode.hashCode());
179
		result = prime * result + ((state == null) ? 0 : state.hashCode());
180
		result = prime * result + ((updateTimestamp == null) ? 0 : updateTimestamp.hashCode());
21924 ashik.ali 181
		return result;
182
	}
183
	@Override
184
	public boolean equals(Object obj) {
185
		if (this == obj)
186
			return true;
187
		if (obj == null)
188
			return false;
189
		if (getClass() != obj.getClass())
190
			return false;
191
		CustomerAddress other = (CustomerAddress) obj;
26817 amit.gupta 192
		if (city == null) {
193
			if (other.city != null)
194
				return false;
195
		} else if (!city.equals(other.city))
196
			return false;
197
		if (country == null) {
198
			if (other.country != null)
199
				return false;
200
		} else if (!country.equals(other.country))
201
			return false;
202
		if (createTimestamp == null) {
203
			if (other.createTimestamp != null)
204
				return false;
205
		} else if (!createTimestamp.equals(other.createTimestamp))
206
			return false;
207
		if (customerId != other.customerId)
208
			return false;
21924 ashik.ali 209
		if (id != other.id)
210
			return false;
26817 amit.gupta 211
		if (landmark == null) {
212
			if (other.landmark != null)
213
				return false;
214
		} else if (!landmark.equals(other.landmark))
215
			return false;
216
		if (lastName == null) {
217
			if (other.lastName != null)
218
				return false;
219
		} else if (!lastName.equals(other.lastName))
220
			return false;
221
		if (line1 == null) {
222
			if (other.line1 != null)
223
				return false;
224
		} else if (!line1.equals(other.line1))
225
			return false;
226
		if (line2 == null) {
227
			if (other.line2 != null)
228
				return false;
229
		} else if (!line2.equals(other.line2))
230
			return false;
231
		if (name == null) {
232
			if (other.name != null)
233
				return false;
234
		} else if (!name.equals(other.name))
235
			return false;
236
		if (phoneNumber == null) {
237
			if (other.phoneNumber != null)
238
				return false;
239
		} else if (!phoneNumber.equals(other.phoneNumber))
240
			return false;
241
		if (pinCode == null) {
242
			if (other.pinCode != null)
243
				return false;
244
		} else if (!pinCode.equals(other.pinCode))
245
			return false;
246
		if (state == null) {
247
			if (other.state != null)
248
				return false;
249
		} else if (!state.equals(other.state))
250
			return false;
251
		if (updateTimestamp == null) {
252
			if (other.updateTimestamp != null)
253
				return false;
254
		} else if (!updateTimestamp.equals(other.updateTimestamp))
255
			return false;
21924 ashik.ali 256
		return true;
257
	}
26817 amit.gupta 258
 
259
 
260
	public String getLastName() {
261
		return lastName;
262
	}
263
	public void setLastName(String lastName) {
264
		this.lastName = lastName;
265
	}
21924 ashik.ali 266
	@Override
21710 ashik.ali 267
	public String toString() {
26817 amit.gupta 268
		return "CustomerAddress [id=" + id + ", name=" + name + ", lastName=" + lastName + ", line1=" + line1
269
				+ ", line2=" + line2 + ", landmark=" + landmark + ", city=" + city + ", state=" + state + ", pinCode="
270
				+ pinCode + ", country=" + country + ", phoneNumber=" + phoneNumber + ", customerId=" + customerId
271
				+ ", createTimestamp=" + createTimestamp + ", updateTimestamp=" + updateTimestamp + "]";
21710 ashik.ali 272
	}
273
 
274
 
275
 
276
}