Subversion Repositories SmartDukaan

Rev

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