Subversion Repositories SmartDukaan

Rev

Rev 26817 | Rev 31860 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 26817 Rev 27045
Line 20... Line 20...
20
 * 
20
 * 
21
 * @author ashikali
21
 * @author ashikali
22
 *
22
 *
23
 */
23
 */
24
@Entity
24
@Entity
25
@Table(name="fofo.customer_address", schema = "fofo")
25
@Table(name = "fofo.customer_address", schema = "fofo")
26
public class CustomerAddress implements Serializable{
26
public class CustomerAddress implements Serializable {
27
	
27
 
28
	private static final long serialVersionUID = 1L;
28
	private static final long serialVersionUID = 1L;
29
	
29
 
30
	public CustomerAddress() {
30
	public CustomerAddress() {
31
	}
31
	}
32
	
32
 
33
	@Id
33
	@Id
34
	@Column(name="id", unique=true, updatable=false)
34
	@Column(name = "id", unique = true, updatable = false)
35
	@GeneratedValue(strategy = GenerationType.IDENTITY)
35
	@GeneratedValue(strategy = GenerationType.IDENTITY)
36
	private int id;
36
	private int id;
37
	
37
 
38
	@Column(name="name")
38
	@Column(name = "name")
39
	private String name;
39
	private String name;
40
	
40
 
41
	@Column(name="last_name")
41
	@Column(name = "last_name")
42
	private String lastName;
42
	private String lastName;
43
	
43
 
44
	@Column(name = "line_1")
44
	@Column(name = "line_1")
45
	private String line1;
45
	private String line1;
46
	
46
 
47
	@Column(name = "line_2")
47
	@Column(name = "line_2")
48
	private String line2;
48
	private String line2;
49
	
49
 
50
	@Column(name = "landmark")
50
	@Column(name = "landmark")
51
	private String landmark;
51
	private String landmark;
52
	
52
 
53
	@Column(name = "city")
53
	@Column(name = "city")
54
	private String city;
54
	private String city;
55
	
55
 
56
	@Column(name = "state")
56
	@Column(name = "state")
57
	private String state;
57
	private String state;
58
	
58
 
59
	@Column(name = "pin_code", length = 10)
59
	@Column(name = "pin_code", length = 10)
60
	private String pinCode;
60
	private String pinCode;
61
	
61
 
62
	@Column(name = "country", length = 100)
62
	@Column(name = "country", length = 100)
63
	private String country;
63
	private String country;
64
	
64
 
65
	@Column(name = "phone_number", length = 20)
65
	@Column(name = "phone_number", length = 20)
66
	private String phoneNumber;
66
	private String phoneNumber;
67
	
67
 
68
	@Column(name = "customer_id")
68
	@Column(name = "customer_id")
69
	private int customerId;
69
	private int customerId;
-
 
70
 
-
 
71
	@Column(name = "active")
-
 
72
	private Boolean active;
-
 
73
 
-
 
74
	public Boolean getActive() {
-
 
75
		return active;
70
	
76
	}
-
 
77
 
-
 
78
	public void setActive(Boolean active) {
-
 
79
		this.active = active;
-
 
80
	}
-
 
81
 
71
	@Convert(converter = LocalDateTimeAttributeConverter.class)
82
	@Convert(converter = LocalDateTimeAttributeConverter.class)
72
	@Column(name="create_timestamp", updatable = false)
83
	@Column(name = "create_timestamp", updatable = false)
73
	private LocalDateTime createTimestamp = LocalDateTime.now();
84
	private LocalDateTime createTimestamp = LocalDateTime.now();
74
	
85
 
75
	@Convert(converter = LocalDateTimeAttributeConverter.class)
86
	@Convert(converter = LocalDateTimeAttributeConverter.class)
76
	@Column(name="update_timestamp")
87
	@Column(name = "update_timestamp")
77
	@UpdateTimestamp
88
	@UpdateTimestamp
78
	private LocalDateTime updateTimestamp = LocalDateTime.now();
89
	private LocalDateTime updateTimestamp = LocalDateTime.now();
79
	
90
 
80
	public int getId() {
91
	public int getId() {
81
		return id;
92
		return id;
82
	}
93
	}
-
 
94
 
83
	public void setId(int id) {
95
	public void setId(int id) {
84
		this.id = id;
96
		this.id = id;
85
	}
97
	}
-
 
98
 
86
	public void setName(String name) {
99
	public void setName(String name) {
87
        this.name = name;
100
		this.name = name;
88
    }
101
	}
-
 
102
 
89
    public String getName() {
103
	public String getName() {
90
        return name;
104
		return name;
91
    }
105
	}
-
 
106
 
92
    public void setLine1(String line1) {
107
	public void setLine1(String line1) {
93
		this.line1 = line1;
108
		this.line1 = line1;
94
	}
109
	}
-
 
110
 
95
    public String getLine1() {
111
	public String getLine1() {
96
		return line1;
112
		return line1;
97
	}
113
	}
-
 
114
 
98
    public void setLine2(String line2) {
115
	public void setLine2(String line2) {
99
		this.line2 = line2;
116
		this.line2 = line2;
100
	}
117
	}
-
 
118
 
101
    public String getLine2() {
119
	public String getLine2() {
102
		return line2;
120
		return line2;
103
	}
121
	}
-
 
122
 
104
    public void setLandmark(String landmark) {
123
	public void setLandmark(String landmark) {
105
		this.landmark = landmark;
124
		this.landmark = landmark;
106
	}
125
	}
-
 
126
 
107
    public String getLandmark() {
127
	public String getLandmark() {
108
		return landmark;
128
		return landmark;
109
	}
129
	}
-
 
130
 
110
    public void setCity(String city) {
131
	public void setCity(String city) {
111
		this.city = city;
132
		this.city = city;
112
	}
133
	}
-
 
134
 
113
    public String getCity() {
135
	public String getCity() {
114
		return city;
136
		return city;
115
	}
137
	}
-
 
138
 
116
    public void setPinCode(String pinCode) {
139
	public void setPinCode(String pinCode) {
117
		this.pinCode = pinCode;
140
		this.pinCode = pinCode;
118
	}
141
	}
-
 
142
 
119
    public String getPinCode() {
143
	public String getPinCode() {
120
		return pinCode;
144
		return pinCode;
121
	}
145
	}
-
 
146
 
122
    public void setState(String state) {
147
	public void setState(String state) {
123
		this.state = state;
148
		this.state = state;
124
	}
149
	}
-
 
150
 
125
    public String getState() {
151
	public String getState() {
126
		return state;
152
		return state;
127
	}
153
	}
-
 
154
 
128
    public void setCountry(String country) {
155
	public void setCountry(String country) {
129
		this.country = country;
156
		this.country = country;
130
	}
157
	}
-
 
158
 
131
    public String getCountry() {
159
	public String getCountry() {
132
		return country;
160
		return country;
133
	}
161
	}
-
 
162
 
134
    public void setPhoneNumber(String phoneNumber) {
163
	public void setPhoneNumber(String phoneNumber) {
135
		this.phoneNumber = phoneNumber;
164
		this.phoneNumber = phoneNumber;
136
	}
165
	}
-
 
166
 
137
    public String getPhoneNumber() {
167
	public String getPhoneNumber() {
138
		return phoneNumber;
168
		return phoneNumber;
139
	}
169
	}
140
    
170
 
141
    public void setCreateTimestamp(LocalDateTime createTimestamp) {
171
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
142
		this.createTimestamp = createTimestamp;
172
		this.createTimestamp = createTimestamp;
143
	}
173
	}
-
 
174
 
144
    public LocalDateTime getCreateTimestamp() {
175
	public LocalDateTime getCreateTimestamp() {
145
		return createTimestamp;
176
		return createTimestamp;
146
	}
177
	}
147
    
178
 
148
    public void setUpdateTimestamp(LocalDateTime updateTimestamp) {
179
	public void setUpdateTimestamp(LocalDateTime updateTimestamp) {
149
		this.updateTimestamp = updateTimestamp;
180
		this.updateTimestamp = updateTimestamp;
150
	}
181
	}
-
 
182
 
151
    public LocalDateTime getUpdateTimestamp() {
183
	public LocalDateTime getUpdateTimestamp() {
152
		return updateTimestamp;
184
		return updateTimestamp;
153
	}
185
	}
154
    
186
 
155
    public int getCustomerId() {
187
	public int getCustomerId() {
156
		return customerId;
188
		return customerId;
157
	}
189
	}
-
 
190
 
158
    public void setCustomerId(int customerId) {
191
	public void setCustomerId(int customerId) {
159
		this.customerId = customerId;
192
		this.customerId = customerId;
160
	}
193
	}
161
    
-
 
162
    
194
 
163
	@Override
195
	@Override
164
	public int hashCode() {
196
	public int hashCode() {
165
		final int prime = 31;
197
		final int prime = 31;
166
		int result = 1;
198
		int result = 1;
-
 
199
		result = prime * result + ((active == null) ? 0 : active.hashCode());
167
		result = prime * result + ((city == null) ? 0 : city.hashCode());
200
		result = prime * result + ((city == null) ? 0 : city.hashCode());
168
		result = prime * result + ((country == null) ? 0 : country.hashCode());
201
		result = prime * result + ((country == null) ? 0 : country.hashCode());
169
		result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
202
		result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
170
		result = prime * result + customerId;
203
		result = prime * result + customerId;
171
		result = prime * result + id;
204
		result = prime * result + id;
Line 178... Line 211...
178
		result = prime * result + ((pinCode == null) ? 0 : pinCode.hashCode());
211
		result = prime * result + ((pinCode == null) ? 0 : pinCode.hashCode());
179
		result = prime * result + ((state == null) ? 0 : state.hashCode());
212
		result = prime * result + ((state == null) ? 0 : state.hashCode());
180
		result = prime * result + ((updateTimestamp == null) ? 0 : updateTimestamp.hashCode());
213
		result = prime * result + ((updateTimestamp == null) ? 0 : updateTimestamp.hashCode());
181
		return result;
214
		return result;
182
	}
215
	}
-
 
216
 
183
	@Override
217
	@Override
184
	public boolean equals(Object obj) {
218
	public boolean equals(Object obj) {
185
		if (this == obj)
219
		if (this == obj)
186
			return true;
220
			return true;
187
		if (obj == null)
221
		if (obj == null)
188
			return false;
222
			return false;
189
		if (getClass() != obj.getClass())
223
		if (getClass() != obj.getClass())
190
			return false;
224
			return false;
191
		CustomerAddress other = (CustomerAddress) obj;
225
		CustomerAddress other = (CustomerAddress) obj;
-
 
226
		if (active == null) {
-
 
227
			if (other.active != null)
-
 
228
				return false;
-
 
229
		} else if (!active.equals(other.active))
-
 
230
			return false;
192
		if (city == null) {
231
		if (city == null) {
193
			if (other.city != null)
232
			if (other.city != null)
194
				return false;
233
				return false;
195
		} else if (!city.equals(other.city))
234
		} else if (!city.equals(other.city))
196
			return false;
235
			return false;
Line 253... Line 292...
253
				return false;
292
				return false;
254
		} else if (!updateTimestamp.equals(other.updateTimestamp))
293
		} else if (!updateTimestamp.equals(other.updateTimestamp))
255
			return false;
294
			return false;
256
		return true;
295
		return true;
257
	}
296
	}
258
	
-
 
259
	
297
 
260
	public String getLastName() {
298
	public String getLastName() {
261
		return lastName;
299
		return lastName;
262
	}
300
	}
-
 
301
 
263
	public void setLastName(String lastName) {
302
	public void setLastName(String lastName) {
264
		this.lastName = lastName;
303
		this.lastName = lastName;
265
	}
304
	}
-
 
305
 
266
	@Override
306
	@Override
267
	public String toString() {
307
	public String toString() {
268
		return "CustomerAddress [id=" + id + ", name=" + name + ", lastName=" + lastName + ", line1=" + line1
308
		return "CustomerAddress [id=" + id + ", name=" + name + ", lastName=" + lastName + ", line1=" + line1
269
				+ ", line2=" + line2 + ", landmark=" + landmark + ", city=" + city + ", state=" + state + ", pinCode="
309
				+ ", line2=" + line2 + ", landmark=" + landmark + ", city=" + city + ", state=" + state + ", pinCode="
270
				+ pinCode + ", country=" + country + ", phoneNumber=" + phoneNumber + ", customerId=" + customerId
310
				+ pinCode + ", country=" + country + ", phoneNumber=" + phoneNumber + ", customerId=" + customerId
271
				+ ", createTimestamp=" + createTimestamp + ", updateTimestamp=" + updateTimestamp + "]";
311
				+ ", active=" + active + ", createTimestamp=" + createTimestamp + ", updateTimestamp=" + updateTimestamp
-
 
312
				+ "]";
272
	}
313
	}
273
    
-
 
274
	
314
 
275
    
-
 
276
}
315
}
277
316