package com.glacier.frame.entity.system;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Pattern;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.Length;
import com.alibaba.fastjson.annotation.JSONField;
import com.glacier.frame.entity.common.util.CommonBuiltin;
import com.glacier.frame.entity.common.util.CommonStatus;
public class User implements Serializable {
private static final long serialVersionUID = 6326148934682228878L;
/**
* 用户主键ID
*/
private String userId;
/**
* 用户名称字母组成,长度为5-15
*/
@Pattern(regexp = "^[a-zA-Z][a-zA-Z0-9_]{4,15}", message = "{User.username.illegal}")
private String username;
/**
* 真实姓名字母组成,长度为2-10
*/
@Pattern(regexp = "^[\u0391-\uFFE5]{2,10}", message = "{User.userCnName.illegal}")
private String userCnName;
private String password;
private String depId;
private String depDisplay;
private String salt;
private CommonStatus status;
private CommonBuiltin builtin;
@Email(message = "{User.email.illegal}")
private String email;
private String userImage;
@Length(max = 255, message = "{Common.remark.illegal}")
private String remark;
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date lastLoginTime;
private String lastLoginIpAddress;
private Integer loginCount;
private String creater;
private String createrDisplay;
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
@Temporal(TemporalType.TIMESTAMP)
private Date createTime;
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getUserCnName() {
return userCnName;
}
public void setUserCnName(String userCnName) {
this.userCnName = userCnName;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getDepId() {
return depId;
}
public void setDepId(String depId) {
this.depId = depId;
}
public String getDepDisplay() {
return depDisplay;
}
public void setDepDisplay(String depDisplay) {
this.depDisplay = depDisplay;
}
public String getSalt() {
return salt;
}
public void setSalt(String salt) {
this.salt = salt;
}
public CommonStatus getStatus() {
return status;
}
public void setStatus(CommonStatus status) {
this.status = status;
}
public CommonBuiltin getBuiltin() {
return builtin;
}
public void setBuiltin(CommonBuiltin builtin) {
this.builtin = builtin;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getUserImage() {
return userImage;
}
public void setUserImage(String userImage) {
this.userImage = userImage;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Date getLastLoginTime() {
return lastLoginTime;
}
public void setLastLoginTime(Date lastLoginTime) {
this.lastLoginTime = lastLoginTime;
}
public String getLastLoginIpAddress() {
return lastLoginIpAddress;
}
public void setLastLoginIpAddress(String lastLoginIpAddress) {
this.lastLoginIpAddress = lastLoginIpAddress;
}
public Integer getLoginCount() {
return loginCount;
}
public void setLoginCount(Integer loginCount) {
this.loginCount = loginCount;
}
public String getCreater() {
return creater;
}
public void setCreater(String creater) {
this.creater = creater;
}
public String getCreaterDisplay() {
return createrDisplay;
}
public void setCreaterDisplay(String createrDisplay) {
this.createrDisplay = createrDisplay;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
User other = (User) that;
return (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getUsername() == null ? other.getUsername() == null : this.getUsername().equals(other.getUsername()))
&& (this.getUserCnName() == null ? other.getUserCnName() == null : this.getUserCnName().equals(other.getUserCnName()))
&& (this.getPassword() == null ? other.getPassword() == null : this.getPassword().equals(other.getPassword()))
&& (this.getDepId() == null ? other.getDepId() == null : this.getDepId().equals(other.getDepId()))
&& (this.getSalt() == null ? other.getSalt() == null : this.getSalt().equals(other.getSalt()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getBuiltin() == null ? other.getBuiltin() == null : this.getBuiltin().equals(other.getBuiltin()))
&& (this.getEmail() == null ? other.getEmail() == null : this.getEmail().equals(other.getEmail()))
&& (this.getUserImage() == null ? other.getUserImage() == null : this.getUserImage().equals(other.getUserImage()))
&& (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
&& (this.getLastLoginTime() == null ? other.getLastLoginTime() == null : this.getLastLoginTime().equals(other.getLastLoginTime()))
&& (this.getLastLoginIpAddress() == null ? other.getLastLoginIpAddress() == null : this.getLastLoginIpAddress().equals(other.getLastLoginIpAddress()))
&& (this.getLoginCount() == null ? other.getLoginCount() == null : this.getLoginCount().equals(other.getLoginCount()))
&& (this.getCreater() == null ? other.getCreater() == null : this.getCreater().equals(other.getCreater()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getUsername() == null) ? 0 : getUsername().hashCode());
result = prime * result + ((getUserCnName() == null) ? 0 : getUserCnName().hashCode());
result = prime * result + ((getPassword() == null) ? 0 : getPassword().hashCode());
result = prime * result + ((getDepId() == null) ? 0 : getDepId().hashCode());
result = prime * result + ((getSalt() == null) ? 0 : getSalt().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getBuiltin() == null) ? 0 : getBuiltin().hashCode());
result = prime * result + ((getEmail() == null) ? 0 : getEmail().hashCode());
result = prime * result + ((getUserImage() == null) ? 0 : getUserImage().hashCode());
result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
result = prime * result + ((getLastLoginTime() == null) ? 0 : getLastLoginTime().hashCode());
result = prime * result + ((getLastLoginIpAddress() == null) ? 0 : getLastLoginIpAddress().hashCode());
result = prime * result + ((getLoginCount() == null) ? 0 : getLoginCount().hashCode());
result = prime * result + ((getCreater() == null) ? 0 : getCreater().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
return result;
}
/*
* (non-Javadoc)
*
*
* @return
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
// TODO Auto-generated method stub
return this.getUserCnName();
}
}