
com.itcoon.common.jpa.base.BaseUserPO Maven / Gradle / Ivy
package com.itcoon.common.jpa.base;
import com.itcoon.common.jpa.domain.type.Gender;
import javax.persistence.*;
/**
* @author Miaoxia Yu
* @date 2020-11-19
*/
@Entity
@Table(name = "user", indexes = {
@Index(columnList = "username", unique = true),
@Index(columnList = "mobile", unique = true),
@Index(columnList = "email", unique = true)
})
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public class BaseUserPO extends TrackablePO {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE)
private Long id;
@Column(length = 50, columnDefinition = "varchar(50) comment '用户名、登录名'")
private String username;
@Column(nullable = false, length = 225, columnDefinition = "varchar(225) comment '密码'")
private String password;
@Column(length = 50, columnDefinition = "varchar(225) comment '电话'")
private String phone;
@Column(columnDefinition = "varchar(225) comment '邮箱'")
private String email;
@Convert(converter = Gender.Converter.class)
@Column(columnDefinition = "int comment '性别'")
private Gender Gender;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Gender getGender() {
return Gender;
}
public void setGender(Gender gender) {
Gender = gender;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy