Subversion Repositories SmartDukaan

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
21545 ashik.ali 1
package com.spice.profitmandi.dao.entity;
2
 
3
import java.io.Serializable;
4
import java.time.LocalDateTime;
5
 
6
import javax.persistence.Basic;
7
import javax.persistence.Column;
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
import javax.persistence.Version;
16
 
17
import com.spice.profitmandi.dao.enumuration.Gender;
18
import com.spice.profitmandi.dao.enumuration.SocialType;
19
 
20
/**
21
 * This class basically contains social user details
22
 * 
23
 * @author ashikali
24
 *
25
 */
26
@Entity
27
@Table(name="social_user", schema = "dtr")
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
 
55
	@Column(name="create_timestamp", updatable = false)
56
	private LocalDateTime createTimestamp = LocalDateTime.now();
57
 
58
	@Column(name="update_timestamp")
59
	private LocalDateTime updateTimestamp = LocalDateTime.now();
60
 
61
	@Basic(optional = false)
62
    @Column(nullable = false)
63
	@Version
64
	private int version;
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
	}
112
 
113
    public void setVersion(int version) {
114
		this.version = version;
115
	}
116
    public int getVersion() {
117
		return version;
118
	}
119
	@Override
120
	public String toString() {
121
		return "SocialUser [id=" + id + ", name=" + name + ", emailId=" + emailId + ", type=" + type
122
				+ ", createTimestamp=" + createTimestamp + ", updateTimestamp=" + updateTimestamp + ", version="
123
				+ version + "]";
124
	}
125
 
126
 
127
 
128
}