Newer
Older
EMS-WEB-3.0 / src / main / java / com / casic / accessControl / user / domain / User.java
ChaiZhuang on 5 Aug 2022 2 KB postgrep接口测试修改
package com.casic.accessControl.user.domain;

import javax.persistence.*;

/**用户信息
 * Created by lenovo on 2016/5/16.
 */
@Entity
@Table(name = "user_info")
public class User {
    private Long id;
    private String userName;
    private String password;
    private String sex;
    private String phoneNumber;
    private Integer isValid;
    private Company company;//所属租户
    private Role role;
    private String datascope; // 数据权限

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Column(name = "userName")
    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    @Column(name = "password")
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Column(name = "sex")
    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    @Column(name = "phoneNumber")
    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    @Column(name = "isValid")
    public Integer getIsValid() {
        return isValid;
    }

    public void setIsValid(Integer isValid) {
        this.isValid = isValid;
    }

    @ManyToOne(fetch = FetchType.EAGER, cascade = { CascadeType.PERSIST })
    @JoinColumn(name = "company")
    public Company getCompany() {
        return company;
    }

    public void setCompany(Company company) {
        this.company = company;
    }

    @ManyToOne(fetch = FetchType.EAGER, cascade = { CascadeType.PERSIST })
    @JoinColumn(name = "role")
    public Role getRole() {
        return role;
    }

    public void setRole(Role role) {
        this.role = role;
    }

    @Column(name = "datascope")
    public String getDatascope() {
        return datascope;
    }

    public void setDatascope(String datascope) {
        this.datascope = datascope;
    }
}