Subversion Repositories SmartDukaan

Rev

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