Subversion Repositories SmartDukaan

Rev

Rev 26776 | Rev 26779 | 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;
21602 ashik.ali 2
 
3
import java.io.Serializable;
4
import java.time.LocalDateTime;
21984 kshitij.so 5
import java.util.List;
21602 ashik.ali 6
 
21984 kshitij.so 7
import javax.persistence.CascadeType;
21602 ashik.ali 8
import javax.persistence.Column;
22009 ashik.ali 9
import javax.persistence.Convert;
21602 ashik.ali 10
import javax.persistence.Entity;
21984 kshitij.so 11
import javax.persistence.FetchType;
21602 ashik.ali 12
import javax.persistence.GeneratedValue;
13
import javax.persistence.GenerationType;
14
import javax.persistence.Id;
21984 kshitij.so 15
import javax.persistence.JoinColumn;
21602 ashik.ali 16
import javax.persistence.NamedQueries;
17
import javax.persistence.NamedQuery;
21984 kshitij.so 18
import javax.persistence.OneToMany;
21602 ashik.ali 19
import javax.persistence.Table;
26778 amit.gupta 20
import javax.persistence.Transient;
21602 ashik.ali 21
 
26774 amit.gupta 22
import com.fasterxml.jackson.annotation.JsonIgnore;
22009 ashik.ali 23
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
24
 
21602 ashik.ali 25
/**
21653 ashik.ali 26
 * This class basically contains  details
21602 ashik.ali 27
 * 
28
 * @author ashikali
29
 *
30
 */
26778 amit.gupta 31
/**
32
 * @author amit
33
 *
34
 */
21602 ashik.ali 35
@Entity
36
@Table(name="fofo.customer", schema = "fofo")
37
@NamedQueries({
38
	@NamedQuery(name="Customer.selectById",query="select c from Customer c where c.id= :id")
39
})
40
public class Customer implements Serializable{
41
 
42
	private static final long serialVersionUID = 1L;
43
 
44
	public Customer() {
45
	}
46
 
47
	@Id
48
	@Column(name="id")
49
	@GeneratedValue(strategy = GenerationType.IDENTITY)
50
	private int id;
51
 
22216 ashik.ali 52
	@Column(name = "first_name", length = 20)
53
	private String firstName;
21687 ashik.ali 54
 
22216 ashik.ali 55
	@Column(name = "last_name", length = 20)
56
	private String lastName;
57
 
21602 ashik.ali 58
	@Column(name="email_id", length = 20)
59
	private String emailId;
60
 
61
	@Column(name="mobile_number", length = 20)
62
	private String mobileNumber;
63
 
26774 amit.gupta 64
	@Column(name="password")
65
	@JsonIgnore
66
	private String password;
67
 
26778 amit.gupta 68
 
69
	@Transient
70
	private boolean passwordExist;
26774 amit.gupta 71
 
26778 amit.gupta 72
	public boolean isPasswordExist() {
73
		return passwordExist;
74
	}
75
	public void setPasswordExist(boolean passwordExist) {
76
		this.passwordExist = passwordExist;
77
	}
26774 amit.gupta 78
	public String getPassword() {
79
		return password;
80
	}
81
	public void setPassword(String password) {
82
		this.password = password;
83
	}
84
	public LocalDateTime getCreateTimestamp() {
85
		return createTimestamp;
86
	}
87
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
88
		this.createTimestamp = createTimestamp;
89
	}
90
 
22009 ashik.ali 91
	@Convert(converter = LocalDateTimeAttributeConverter.class)
21677 ashik.ali 92
	@Column(name = "create_timestamp")
21602 ashik.ali 93
	private LocalDateTime createTimestamp = LocalDateTime.now();
21984 kshitij.so 94
 
95
	@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY)
96
	@JoinColumn(name="customer_id",insertable=false,updatable=false,nullable=false)
26776 amit.gupta 97
	@JsonIgnore
21984 kshitij.so 98
	private List<CustomerAddress> customerAddress;	
99
 
100
	public List<CustomerAddress> getCustomerAddress() {
101
		return customerAddress;
102
	}
103
	public void setCustomerAddress(List<CustomerAddress> customerAddress) {
104
		this.customerAddress = customerAddress;
105
	}
106
	public int getId() {
107
		return id;
108
	}
109
	public void setId(int id) {
110
		this.id = id;
111
	}
112
 
22216 ashik.ali 113
	public String getFirstName() {
114
		return firstName;
21984 kshitij.so 115
	}
22216 ashik.ali 116
	public void setFirstName(String firstName) {
117
		this.firstName = firstName;
21984 kshitij.so 118
	}
119
 
22216 ashik.ali 120
	public String getLastName() {
121
		return lastName;
122
	}
123
	public void setLastName(String lastName) {
124
		this.lastName = lastName;
125
	}
126
 
21984 kshitij.so 127
	public String getEmailId() {
128
		return emailId;
129
	}
130
	public void setEmailId(String emailId) {
131
		this.emailId = emailId;
132
	}
133
 
134
	public String getMobileNumber() {
135
		return mobileNumber;
136
	}
137
	public void setMobileNumber(String mobileNumber) {
138
		this.mobileNumber = mobileNumber;
139
	}
140
 
22009 ashik.ali 141
 
142
 
21924 ashik.ali 143
	@Override
22009 ashik.ali 144
	public int hashCode() {
145
		final int prime = 31;
146
		int result = 1;
147
		result = prime * result + id;
148
		return result;
149
	}
150
	@Override
151
	public boolean equals(Object obj) {
152
		if (this == obj)
153
			return true;
154
		if (obj == null)
155
			return false;
156
		if (getClass() != obj.getClass())
157
			return false;
158
		Customer other = (Customer) obj;
159
		if (id != other.id)
160
			return false;
161
		return true;
162
	}
163
	@Override
21602 ashik.ali 164
	public String toString() {
22243 ashik.ali 165
		return "Customer [id=" + id + ", firstName=" + firstName + ", lastName=" + lastName + ", emailId=" + emailId 
166
				+ ", mobileNumber=" + mobileNumber + ", createTimestamp=" + createTimestamp + ", customerAddress=" 
167
				+ customerAddress + "]";
21602 ashik.ali 168
	}
169
 
22216 ashik.ali 170
 
21602 ashik.ali 171
}