Subversion Repositories SmartDukaan

Rev

Rev 21720 | Rev 22009 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
21720 ashik.ali 1
package com.spice.profitmandi.dao.entity.dtr;
21545 ashik.ali 2
 
3
import java.io.Serializable;
4
import java.time.LocalDateTime;
5
 
6
import javax.persistence.Column;
7
import javax.persistence.Entity;
8
import javax.persistence.EnumType;
9
import javax.persistence.Enumerated;
10
import javax.persistence.GeneratedValue;
11
import javax.persistence.GenerationType;
12
import javax.persistence.Id;
13
import javax.persistence.Table;
14
 
21720 ashik.ali 15
import com.spice.profitmandi.dao.enumuration.dtr.Gender;
16
import com.spice.profitmandi.dao.enumuration.dtr.SocialType;
21545 ashik.ali 17
 
18
/**
19
 * This class basically contains social user details
20
 * 
21
 * @author ashikali
22
 *
23
 */
24
@Entity
21720 ashik.ali 25
@Table(name="dtr.social_user", schema = "dtr")
21545 ashik.ali 26
 
27
public class SocialUser implements Serializable{
28
 
29
	private static final long serialVersionUID = 1L;
30
 
31
	public SocialUser() {
32
	}
33
 
34
	@Id
35
	@Column(name="id", unique=true, updatable=false)
36
	@GeneratedValue(strategy = GenerationType.IDENTITY)
37
	private int id;
38
 
39
	@Column(name = "name")
40
	private String name;
41
 
42
	@Column(name = "email_id", unique = true)
43
	private String emailId;
44
 
45
	@Column(name = "gender")
46
	@Enumerated(EnumType.STRING)
47
	private Gender gender;
48
 
49
	@Column(name="type")
50
    @Enumerated(EnumType.STRING)
51
    private SocialType type;
52
 
53
	@Column(name="create_timestamp", updatable = false)
54
	private LocalDateTime createTimestamp = LocalDateTime.now();
55
 
56
	@Column(name="update_timestamp")
57
	private LocalDateTime updateTimestamp = LocalDateTime.now();
58
 
59
	public int getId() {
60
		return id;
61
	}
62
	public void setId(int id) {
63
		this.id = id;
64
	}
65
 
66
	public String getName() {
67
		return name;
68
	}
69
	public void setName(String name) {
70
		this.name = name;
71
	}
72
	public String getEmailId() {
73
		return emailId;
74
	}
75
	public void setEmailId(String emailId) {
76
		this.emailId = emailId;
77
	}
78
 
79
	public SocialType getType() {
80
		return type;
81
	}
82
	public void setType(SocialType type) {
83
		this.type = type;
84
	}
85
 
86
	public void setGender(Gender gender) {
87
		this.gender = gender;
88
	}
89
	public Gender getGender() {
90
		return gender;
91
	}
92
 
93
    public void setCreateTimestamp(LocalDateTime createTimestamp) {
94
		this.createTimestamp = createTimestamp;
95
	}
96
    public LocalDateTime getCreateTimestamp() {
97
		return createTimestamp;
98
	}
99
    public LocalDateTime getUpdateTimestamp() {
100
		return updateTimestamp;
101
	}
102
    public void setUpdateTimestamp(LocalDateTime updateTimestamp) {
103
		this.updateTimestamp = updateTimestamp;
104
	}
21924 ashik.ali 105
 
106
 
21545 ashik.ali 107
	@Override
21924 ashik.ali 108
	public int hashCode() {
109
		final int prime = 31;
110
		int result = 1;
111
		result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
112
		result = prime * result + ((emailId == null) ? 0 : emailId.hashCode());
113
		result = prime * result + ((gender == null) ? 0 : gender.hashCode());
114
		result = prime * result + id;
115
		result = prime * result + ((name == null) ? 0 : name.hashCode());
116
		result = prime * result + ((type == null) ? 0 : type.hashCode());
117
		result = prime * result + ((updateTimestamp == null) ? 0 : updateTimestamp.hashCode());
118
		return result;
119
	}
120
	@Override
121
	public boolean equals(Object obj) {
122
		if (this == obj)
123
			return true;
124
		if (obj == null)
125
			return false;
126
		if (getClass() != obj.getClass())
127
			return false;
128
		SocialUser other = (SocialUser) obj;
129
		if (createTimestamp == null) {
130
			if (other.createTimestamp != null)
131
				return false;
132
		} else if (!createTimestamp.equals(other.createTimestamp))
133
			return false;
134
		if (emailId == null) {
135
			if (other.emailId != null)
136
				return false;
137
		} else if (!emailId.equals(other.emailId))
138
			return false;
139
		if (gender != other.gender)
140
			return false;
141
		if (id != other.id)
142
			return false;
143
		if (name == null) {
144
			if (other.name != null)
145
				return false;
146
		} else if (!name.equals(other.name))
147
			return false;
148
		if (type != other.type)
149
			return false;
150
		if (updateTimestamp == null) {
151
			if (other.updateTimestamp != null)
152
				return false;
153
		} else if (!updateTimestamp.equals(other.updateTimestamp))
154
			return false;
155
		return true;
156
	}
157
	@Override
21545 ashik.ali 158
	public String toString() {
159
		return "SocialUser [id=" + id + ", name=" + name + ", emailId=" + emailId + ", type=" + type
21693 ashik.ali 160
				+ ", createTimestamp=" + createTimestamp + ", updateTimestamp=" + updateTimestamp + "]";
21545 ashik.ali 161
	}
162
 
163
 
164
 
165
}