Subversion Repositories SmartDukaan

Rev

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

Rev 21924 Rev 22009
Line 2... Line 2...
2
 
2
 
3
import java.io.Serializable;
3
import java.io.Serializable;
4
import java.time.LocalDateTime;
4
import java.time.LocalDateTime;
5
 
5
 
6
import javax.persistence.Column;
6
import javax.persistence.Column;
-
 
7
import javax.persistence.Convert;
7
import javax.persistence.Entity;
8
import javax.persistence.Entity;
8
import javax.persistence.EnumType;
9
import javax.persistence.EnumType;
9
import javax.persistence.Enumerated;
10
import javax.persistence.Enumerated;
10
import javax.persistence.GeneratedValue;
11
import javax.persistence.GeneratedValue;
11
import javax.persistence.GenerationType;
12
import javax.persistence.GenerationType;
12
import javax.persistence.Id;
13
import javax.persistence.Id;
13
import javax.persistence.Table;
14
import javax.persistence.Table;
14
 
15
 
-
 
16
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
15
import com.spice.profitmandi.dao.enumuration.dtr.Gender;
17
import com.spice.profitmandi.dao.enumuration.dtr.Gender;
16
import com.spice.profitmandi.dao.enumuration.dtr.SocialType;
18
import com.spice.profitmandi.dao.enumuration.dtr.SocialType;
17
 
19
 
18
/**
20
/**
19
 * This class basically contains social user details
21
 * This class basically contains social user details
Line 48... Line 50...
48
	
50
	
49
	@Column(name="type")
51
	@Column(name="type")
50
    @Enumerated(EnumType.STRING)
52
    @Enumerated(EnumType.STRING)
51
    private SocialType type;
53
    private SocialType type;
52
	
54
	
-
 
55
	@Convert(converter = LocalDateTimeAttributeConverter.class)
53
	@Column(name="create_timestamp", updatable = false)
56
	@Column(name="create_timestamp", updatable = false)
54
	private LocalDateTime createTimestamp = LocalDateTime.now();
57
	private LocalDateTime createTimestamp = LocalDateTime.now();
55
	
58
	
-
 
59
	@Convert(converter = LocalDateTimeAttributeConverter.class)
56
	@Column(name="update_timestamp")
60
	@Column(name="update_timestamp")
57
	private LocalDateTime updateTimestamp = LocalDateTime.now();
61
	private LocalDateTime updateTimestamp = LocalDateTime.now();
58
	
62
	
59
	public int getId() {
63
	public int getId() {
60
		return id;
64
		return id;
Line 102... Line 106...
102
    public void setUpdateTimestamp(LocalDateTime updateTimestamp) {
106
    public void setUpdateTimestamp(LocalDateTime updateTimestamp) {
103
		this.updateTimestamp = updateTimestamp;
107
		this.updateTimestamp = updateTimestamp;
104
	}
108
	}
105
    
109
    
106
    
110
    
-
 
111
	
107
	@Override
112
	@Override
108
	public int hashCode() {
113
	public int hashCode() {
109
		final int prime = 31;
114
		final int prime = 31;
110
		int result = 1;
115
		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;
116
		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;
117
		return result;
119
	}
118
	}
120
	@Override
119
	@Override
121
	public boolean equals(Object obj) {
120
	public boolean equals(Object obj) {
122
		if (this == obj)
121
		if (this == obj)
Line 124... Line 123...
124
		if (obj == null)
123
		if (obj == null)
125
			return false;
124
			return false;
126
		if (getClass() != obj.getClass())
125
		if (getClass() != obj.getClass())
127
			return false;
126
			return false;
128
		SocialUser other = (SocialUser) obj;
127
		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)
128
		if (id != other.id)
142
			return false;
129
			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;
130
		return true;
156
	}
131
	}
157
	@Override
132
	@Override
158
	public String toString() {
133
	public String toString() {
159
		return "SocialUser [id=" + id + ", name=" + name + ", emailId=" + emailId + ", type=" + type
134
		return "SocialUser [id=" + id + ", name=" + name + ", emailId=" + emailId + ", type=" + type
160
				+ ", createTimestamp=" + createTimestamp + ", updateTimestamp=" + updateTimestamp + "]";
135
				+ ", createTimestamp=" + createTimestamp + ", updateTimestamp=" + updateTimestamp + "]";
161
	}
136
	}
162
	
137
	
163
	
-
 
164
    
-
 
165
}
138
}
166
139