Subversion Repositories SmartDukaan

Rev

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

Rev 26779 Rev 26861
Line 1... Line 1...
1
package com.spice.profitmandi.dao.entity.fofo;
1
package com.spice.profitmandi.dao.entity.fofo;
2
 
2
 
3
import java.io.Serializable;
3
import java.io.Serializable;
-
 
4
import java.time.LocalDate;
4
import java.time.LocalDateTime;
5
import java.time.LocalDateTime;
5
import java.util.List;
6
import java.util.List;
6
 
7
 
7
import javax.persistence.CascadeType;
8
import javax.persistence.CascadeType;
8
import javax.persistence.Column;
9
import javax.persistence.Column;
Line 31... Line 32...
31
/**
32
/**
32
 * @author amit
33
 * @author amit
33
 *
34
 *
34
 */
35
 */
35
@Entity
36
@Entity
36
@Table(name="fofo.customer", schema = "fofo")
37
@Table(name = "fofo.customer", schema = "fofo")
37
@NamedQueries({
-
 
38
	@NamedQuery(name="Customer.selectById",query="select c from Customer c where c.id= :id")
38
@NamedQueries({ @NamedQuery(name = "Customer.selectById", query = "select c from Customer c where c.id= :id") })
39
})
-
 
40
public class Customer implements Serializable{
39
public class Customer implements Serializable {
41
	
40
 
42
	private static final long serialVersionUID = 1L;
41
	private static final long serialVersionUID = 1L;
43
	
42
 
44
	public Customer() {
43
	public Customer() {
45
	}
44
	}
46
	
45
 
47
	@Id
46
	@Id
48
	@Column(name="id")
47
	@Column(name = "id")
49
	@GeneratedValue(strategy = GenerationType.IDENTITY)
48
	@GeneratedValue(strategy = GenerationType.IDENTITY)
50
	private int id;
49
	private int id;
51
	
50
 
52
	@Column(name = "first_name", length = 20)
51
	@Column(name = "first_name", length = 20)
53
	private String firstName;
52
	private String firstName;
54
	
53
 
55
	@Column(name = "last_name", length = 20)
54
	@Column(name = "last_name", length = 20)
56
	private String lastName;
55
	private String lastName;
57
	
56
 
58
	@Column(name="email_id", length = 20)
57
	@Column(name = "email_id", length = 20)
59
	private String emailId;
58
	private String emailId;
60
	
59
 
61
	@Column(name="mobile_number", length = 20)
60
	@Column(name = "mobile_number", length = 20)
62
	private String mobileNumber;
61
	private String mobileNumber;
-
 
62
 
-
 
63
	@Column(name = "gender")
-
 
64
	private String gender;
63
	
65
 
-
 
66
	@Column(name = "date_of_birth")
-
 
67
	private LocalDate dob;
-
 
68
 
64
	@Column(name="password")
69
	@Column(name = "password")
65
	@JsonIgnore
70
	@JsonIgnore
66
	private String password;
71
	private String password;
67
	
-
 
68
 
72
 
69
	@Transient
73
	@Transient
70
	private boolean passwordExist;
74
	private boolean passwordExist;
-
 
75
 
-
 
76
	public String getGender() {
-
 
77
		return gender;
71
	
78
	}
-
 
79
 
-
 
80
	public void setGender(String gender) {
-
 
81
		this.gender = gender;
-
 
82
	}
-
 
83
 
-
 
84
	public LocalDate getDob() {
-
 
85
		return dob;
-
 
86
	}
-
 
87
 
-
 
88
	public void setDob(LocalDate dob) {
-
 
89
		this.dob = dob;
-
 
90
	}
-
 
91
 
72
	public boolean isPasswordExist() {
92
	public boolean isPasswordExist() {
73
		return passwordExist;
93
		return passwordExist;
74
	}
94
	}
-
 
95
 
75
	public void setPasswordExist(boolean passwordExist) {
96
	public void setPasswordExist(boolean passwordExist) {
76
		this.passwordExist = passwordExist;
97
		this.passwordExist = passwordExist;
77
	}
98
	}
-
 
99
 
78
	public String getPassword() {
100
	public String getPassword() {
79
		return password;
101
		return password;
80
	}
102
	}
-
 
103
 
81
	public void setPassword(String password) {
104
	public void setPassword(String password) {
82
		this.password = password;
105
		this.password = password;
83
	}
106
	}
-
 
107
 
84
	public LocalDateTime getCreateTimestamp() {
108
	public LocalDateTime getCreateTimestamp() {
85
		return createTimestamp;
109
		return createTimestamp;
86
	}
110
	}
-
 
111
 
87
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
112
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
88
		this.createTimestamp = createTimestamp;
113
		this.createTimestamp = createTimestamp;
89
	}
114
	}
90
 
115
 
91
	@Convert(converter = LocalDateTimeAttributeConverter.class)
116
	@Convert(converter = LocalDateTimeAttributeConverter.class)
92
	@Column(name = "create_timestamp")
117
	@Column(name = "create_timestamp")
93
	private LocalDateTime createTimestamp = LocalDateTime.now();
118
	private LocalDateTime createTimestamp = LocalDateTime.now();
94
 
119
 
95
	@JsonIgnore
120
	@JsonIgnore
96
	@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.EAGER)
121
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
97
	@JoinColumn(name="customer_id",insertable=false,updatable=false,nullable=false)
122
	@JoinColumn(name = "customer_id", insertable = false, updatable = false, nullable = false)
98
	private List<CustomerAddress> customerAddress;	
123
	private List<CustomerAddress> customerAddress;
99
	
124
 
100
	public List<CustomerAddress> getCustomerAddress() {
125
	public List<CustomerAddress> getCustomerAddress() {
101
		return customerAddress;
126
		return customerAddress;
102
	}
127
	}
-
 
128
 
103
	public void setCustomerAddress(List<CustomerAddress> customerAddress) {
129
	public void setCustomerAddress(List<CustomerAddress> customerAddress) {
104
		this.customerAddress = customerAddress;
130
		this.customerAddress = customerAddress;
105
	}
131
	}
-
 
132
 
106
	public int getId() {
133
	public int getId() {
107
		return id;
134
		return id;
108
	}
135
	}
-
 
136
 
109
	public void setId(int id) {
137
	public void setId(int id) {
110
		this.id = id;
138
		this.id = id;
111
	}
139
	}
112
	
140
 
113
	public String getFirstName() {
141
	public String getFirstName() {
114
		return firstName;
142
		return firstName;
115
	}
143
	}
-
 
144
 
116
	public void setFirstName(String firstName) {
145
	public void setFirstName(String firstName) {
117
		this.firstName = firstName;
146
		this.firstName = firstName;
118
	}
147
	}
119
	
148
 
120
	public String getLastName() {
149
	public String getLastName() {
121
		return lastName;
150
		return lastName;
122
	}
151
	}
-
 
152
 
123
	public void setLastName(String lastName) {
153
	public void setLastName(String lastName) {
124
		this.lastName = lastName;
154
		this.lastName = lastName;
125
	}
155
	}
126
	
156
 
127
	public String getEmailId() {
157
	public String getEmailId() {
128
		return emailId;
158
		return emailId;
129
	}
159
	}
-
 
160
 
130
	public void setEmailId(String emailId) {
161
	public void setEmailId(String emailId) {
131
		this.emailId = emailId;
162
		this.emailId = emailId;
132
	}
163
	}
133
	
164
 
134
	public String getMobileNumber() {
165
	public String getMobileNumber() {
135
		return mobileNumber;
166
		return mobileNumber;
136
	}
167
	}
-
 
168
 
137
	public void setMobileNumber(String mobileNumber) {
169
	public void setMobileNumber(String mobileNumber) {
138
		this.mobileNumber = mobileNumber;
170
		this.mobileNumber = mobileNumber;
139
	}
171
	}
140
	
-
 
141
	
-
 
142
	
172
 
143
	@Override
173
	@Override
144
	public int hashCode() {
174
	public int hashCode() {
145
		final int prime = 31;
175
		final int prime = 31;
146
		int result = 1;
176
		int result = 1;
147
		result = prime * result + id;
177
		result = prime * result + id;
148
		return result;
178
		return result;
149
	}
179
	}
-
 
180
 
150
	@Override
181
	@Override
151
	public boolean equals(Object obj) {
182
	public boolean equals(Object obj) {
152
		if (this == obj)
183
		if (this == obj)
153
			return true;
184
			return true;
154
		if (obj == null)
185
		if (obj == null)
Line 158... Line 189...
158
		Customer other = (Customer) obj;
189
		Customer other = (Customer) obj;
159
		if (id != other.id)
190
		if (id != other.id)
160
			return false;
191
			return false;
161
		return true;
192
		return true;
162
	}
193
	}
-
 
194
 
163
	@Override
195
	@Override
164
	public String toString() {
196
	public String toString() {
165
		return "Customer [id=" + id + ", firstName=" + firstName + ", lastName=" + lastName + ", emailId=" + emailId 
197
		return "Customer [id=" + id + ", firstName=" + firstName + ", lastName=" + lastName + ", emailId=" + emailId
-
 
198
				+ ", mobileNumber=" + mobileNumber + ", gender=" + gender + ", dob=" + dob + ", password=" + password
166
				+ ", mobileNumber=" + mobileNumber + ", createTimestamp=" + createTimestamp + ", customerAddress=" 
199
				+ ", passwordExist=" + passwordExist + ", createTimestamp=" + createTimestamp + ", customerAddress="
167
				+ customerAddress + "]";
200
				+ customerAddress + "]";
168
	}
201
	}
169
	
-
 
170
	
202
 
171
}
203
}
172
204