Subversion Repositories SmartDukaan

Rev

Rev 21924 | Rev 22216 | 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
 
22009 ashik.ali 14
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
15
 
21710 ashik.ali 16
/**
17
 * This class basically contains address details
18
 * 
19
 * @author ashikali
20
 *
21
 */
22
@Entity
21895 ashik.ali 23
@Table(name="fofo.customer_address", schema = "fofo")
21710 ashik.ali 24
public class CustomerAddress implements Serializable{
25
 
26
	private static final long serialVersionUID = 1L;
27
 
28
	public CustomerAddress() {
29
	}
30
 
31
	@Id
32
	@Column(name="id", unique=true, updatable=false)
33
	@GeneratedValue(strategy = GenerationType.IDENTITY)
34
	private int id;
35
 
36
	@Column(name="name")
37
	private String name;
38
 
39
	@Column(name = "line_1")
40
	private String line1;
41
 
42
	@Column(name = "line_2")
43
	private String line2;
44
 
45
	@Column(name = "landmark")
46
	private String landmark;
47
 
48
	@Column(name = "city")
49
	private String city;
50
 
51
	@Column(name = "state")
52
	private String state;
53
 
21895 ashik.ali 54
	@Column(name = "pin_code", length = 10)
21710 ashik.ali 55
	private String pinCode;
56
 
57
	@Column(name = "country", length = 100)
58
	private String country;
59
 
21895 ashik.ali 60
	@Column(name = "phone_number", length = 20)
21710 ashik.ali 61
	private String phoneNumber;
62
 
63
	@Column(name = "customer_id")
64
	private int customerId;
65
 
22009 ashik.ali 66
	@Convert(converter = LocalDateTimeAttributeConverter.class)
21710 ashik.ali 67
	@Column(name="create_timestamp", updatable = false)
68
	private LocalDateTime createTimestamp = LocalDateTime.now();
69
 
22009 ashik.ali 70
	@Convert(converter = LocalDateTimeAttributeConverter.class)
21710 ashik.ali 71
	@Column(name="update_timestamp")
72
	private LocalDateTime updateTimestamp = LocalDateTime.now();
73
 
74
	public int getId() {
75
		return id;
76
	}
77
	public void setId(int id) {
78
		this.id = id;
79
	}
80
	public void setName(String name) {
81
        this.name = name;
82
    }
83
    public String getName() {
84
        return name;
85
    }
86
    public void setLine1(String line1) {
87
		this.line1 = line1;
88
	}
89
    public String getLine1() {
90
		return line1;
91
	}
92
    public void setLine2(String line2) {
93
		this.line2 = line2;
94
	}
95
    public String getLine2() {
96
		return line2;
97
	}
98
    public void setLandmark(String landmark) {
99
		this.landmark = landmark;
100
	}
101
    public String getLandmark() {
102
		return landmark;
103
	}
104
    public void setCity(String city) {
105
		this.city = city;
106
	}
107
    public String getCity() {
108
		return city;
109
	}
110
    public void setPinCode(String pinCode) {
111
		this.pinCode = pinCode;
112
	}
113
    public String getPinCode() {
114
		return pinCode;
115
	}
116
    public void setState(String state) {
117
		this.state = state;
118
	}
119
    public String getState() {
120
		return state;
121
	}
122
    public void setCountry(String country) {
123
		this.country = country;
124
	}
125
    public String getCountry() {
126
		return country;
127
	}
128
    public void setPhoneNumber(String phoneNumber) {
129
		this.phoneNumber = phoneNumber;
130
	}
131
    public String getPhoneNumber() {
132
		return phoneNumber;
133
	}
134
 
135
    public void setCreateTimestamp(LocalDateTime createTimestamp) {
136
		this.createTimestamp = createTimestamp;
137
	}
138
    public LocalDateTime getCreateTimestamp() {
139
		return createTimestamp;
140
	}
141
 
142
    public void setUpdateTimestamp(LocalDateTime updateTimestamp) {
143
		this.updateTimestamp = updateTimestamp;
144
	}
145
    public LocalDateTime getUpdateTimestamp() {
146
		return updateTimestamp;
147
	}
148
 
149
    public int getCustomerId() {
150
		return customerId;
151
	}
152
    public void setCustomerId(int customerId) {
153
		this.customerId = customerId;
154
	}
21924 ashik.ali 155
 
156
 
21710 ashik.ali 157
	@Override
21924 ashik.ali 158
	public int hashCode() {
159
		final int prime = 31;
160
		int result = 1;
161
		result = prime * result + id;
162
		return result;
163
	}
164
	@Override
165
	public boolean equals(Object obj) {
166
		if (this == obj)
167
			return true;
168
		if (obj == null)
169
			return false;
170
		if (getClass() != obj.getClass())
171
			return false;
172
		CustomerAddress other = (CustomerAddress) obj;
173
		if (id != other.id)
174
			return false;
175
		return true;
176
	}
177
	@Override
21710 ashik.ali 178
	public String toString() {
179
		return "CustomerAddress [id=" + id + ", name=" + name + ", line1=" + line1 + ", line2=" + line2 + ", landmark="
180
				+ landmark + ", city=" + city + ", state=" + state + ", pinCode=" + pinCode + ", country=" + country
181
				+ ", phoneNumber=" + phoneNumber + ", customerId=" + customerId + ", createTimestamp=" + createTimestamp
182
				+ ", updateTimestamp=" + updateTimestamp + "]";
183
	}
184
 
185
 
186
 
187
}