Subversion Repositories SmartDukaan

Rev

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