package com.qxueyou.scc.user.model; import com.fasterxml.jackson.annotation.JsonIgnore; import org.hibernate.annotations.GenericGenerator; import org.springframework.format.annotation.DateTimeFormat; import javax.persistence.*; import java.io.Serializable; import java.util.Date; import java.util.List; /** * 用户表 实体 * * @author ody.yuan */ @Entity(name = "User") @Table(name = "user") @NamedQuery(name = "User.findAll", query = "SELECT u FROM User u") public class User implements Serializable, com.qxueyou.scc.base.model.ITrace { private static final long serialVersionUID = 1L; /** * 主键 */ @Id @GeneratedValue(generator = "hibernate-uuid") @GenericGenerator(name = "hibernate-uuid", strategy = "uuid") @Column(name = "USER_ID", unique = true, nullable = false, length = 32) private String userId; /** * 创建者ID */ @Column(name = "CREATE_ID", nullable = false, length = 32) @JsonIgnore private String createId; /** * 创建时间 */ @Column(name = "CREATE_TIME", nullable = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonIgnore private Date createTime; /** * 创建人 */ @Column(name = "CREATOR", nullable = false, length = 100) @JsonIgnore private String creator; /** * 删除标志 */ @Column(name = "DELETE_FLAG", nullable = false) @JsonIgnore private boolean deleteFlag; /** * 用户头像路径 */ @Column(name = "IMG_PATH", length = 255) private String imgPath; /** * 手机号 */ @Column(name = "MOBILE_PHONE", length = 15) private String mobilePhone; /** * 来源 */ @Column(name = "SOURCE", length = 16) private String source; /** * 邮箱 */ @Column(name = "E_MAIL", length = 64) private String email; /** * 微博号 */ @Column(name = "AGE") private Integer age; /** * 姓名 */ @Column(name = "NAME", length = 150) private String name; /** * 登录账号 */ @Column(name = "ACCOUNT", length = 64) private String account; /** * 密码 */ @Column(name = "PASSWORD", length = 255) private String password; /** * 修改人ID */ @Column(name = "UPDATE_ID", length = 32) @JsonIgnore private String updateId; /** * 修改时间 */ @Column(name = "UPDATE_TIME", nullable = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonIgnore private Date updateTime; /** * 修改人 */ @Column(name = "UPDATOR", length = 100) @JsonIgnore private String updator; /** * 性别 */ @Column(name = "SEX") private boolean sex; /** * 绑定账号ID */ @Column(name = "IMEI", length = 255) private String imei; /** * 绑定账号ID */ @Column(name = "OPENID", length = 255) private String openId; public String getOpenId() { return openId; } public void setOpenId(String openId) { this.openId = openId; } @ManyToMany(fetch = FetchType.LAZY, mappedBy = "users") @JsonIgnore private List roles; @OneToMany(mappedBy = "user", fetch = FetchType.LAZY) @JsonIgnore private List userRoleRes; @Column(name = "ORGANIZATION_ID", length = 32) private String organizationId; public List getRoles() { return roles; } public void setRoles(List roles) { this.roles = roles; } public String getAccount() { return account; } public void setAccount(String account) { this.account = account; } public String getOrganizationId() { return organizationId; } public void setOrganizationId(String organizationId) { this.organizationId = organizationId; } public boolean getSex() { return sex; } public void setSex(boolean sex) { this.sex = sex; } public String getUserId() { return this.userId; } public void setUserId(String userId) { this.userId = userId; } public String getCreateId() { return this.createId; } public void setCreateId(String createId) { this.createId = createId; } public Date getCreateTime() { return this.createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } public String getCreator() { return this.creator; } public void setCreator(String creator) { this.creator = creator; } public boolean getDeleteFlag() { return this.deleteFlag; } public void setDeleteFlag(boolean deleteFlag) { this.deleteFlag = deleteFlag; } public String getImgPath() { return this.imgPath; } public void setImgPath(String imgPath) { this.imgPath = imgPath; } public String getMobilePhone() { return this.mobilePhone; } public void setMobilePhone(String mobilePhone) { this.mobilePhone = mobilePhone; } public String getName() { return this.name; } public void setName(String name) { this.name = name; } public String getPassword() { return this.password; } public void setPassword(String password) { this.password = password; } public String getUpdateId() { return this.updateId; } public void setUpdateId(String updateId) { this.updateId = updateId; } public Date getUpdateTime() { return this.updateTime; } public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; } public String getUpdator() { return this.updator; } public void setUpdator(String updator) { this.updator = updator; } public String getSource() { return source; } public void setSource(String source) { this.source = source; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public Integer getAge() { return age; } public void setAge(Integer age) { this.age = age; } public String getImei() { return imei; } public void setImei(String imei) { this.imei = imei; } public List getUserRoleRes() { return userRoleRes; } public void setUserRoleRes(List userRoleRes) { this.userRoleRes = userRoleRes; } @Override public String toString() { return "User [userId=" + userId + ", createId=" + createId + ", createTime=" + createTime + ", creator=" + creator + ", deleteFlag=" + deleteFlag + ", imgPath=" + imgPath + ", mobilePhone=" + mobilePhone + ", source=" + source + ", email=" + email + ", age=" + age + ", name=" + name + ", account=" + account + ", password=" + password + ", updateId=" + updateId + ", updateTime=" + updateTime + ", updator=" + updator + ", sex=" + sex + ", imei=" + imei + ", roles=" + roles + ", userRoleRes=" + userRoleRes + "]"; } }