Java多对多映射

疫情数据

数据分为疫情数据和用户数据两个大的类型。
疫情数据:由Area接口设计整体的标准。由Aborad类,Organization类,MyCountry类来实现并完成具体的数据保存,Province类,City类来继承MyCountry类并完成具体的数据保存。
用户数据:People接口设计整体标准,由User,Admin来实现并具体完成数据的保存。
用户信息里面保存有省,市,组织的名字,个人信息。
组织信息里面保存有省,市的名字,所包含的用户列表,疫情数据。
市的信息里面保存有省的名字,所包含的组织,用户列表,疫情数据。
省的信息里面保存有所包含的市,组织,用户列表,疫情数据。
国外的信息里面包含有疫情数据。
各类代码:
Area

package 链表的使用;

public interface Area {
//    定义地区的标准
    public String getName();
}

Abroad

package 链表的使用;

public class Abroad implements Area{
    private Integer id;
    private String name;
    private Integer newConfirmedCases;
    private Integer newDeaths;
    private Integer existingConfirmedDiagnosis;
    private Integer cumulativeDiagnosis;
    private Integer cumulativeDeaths;
    private Integer cumulative_cure;

    public Abroad() {
    }

    public Abroad(String name, Integer newConfirmedCases, Integer newDeaths, Integer existingConfirmedDiagnosis, Integer cumulativeDiagnosis, Integer cumulativeDeaths, Integer cumulative_cure) {
        this.name = name;
        this.newConfirmedCases = newConfirmedCases;
        this.newDeaths = newDeaths;
        this.existingConfirmedDiagnosis = existingConfirmedDiagnosis;
        this.cumulativeDiagnosis = cumulativeDiagnosis;
        this.cumulativeDeaths = cumulativeDeaths;
        this.cumulative_cure = cumulative_cure;
    }

    public Abroad(Integer id, String name, Integer newConfirmedCases, Integer newDeaths, Integer existingConfirmedDiagnosis, Integer cumulativeDiagnosis, Integer cumulativeDeaths, Integer cumulative_cure) {
        this.id = id;
        this.name = name;
        this.newConfirmedCases = newConfirmedCases;
        this.newDeaths = newDeaths;
        this.existingConfirmedDiagnosis = existingConfirmedDiagnosis;
        this.cumulativeDiagnosis = cumulativeDiagnosis;
        this.cumulativeDeaths = cumulativeDeaths;
        this.cumulative_cure = cumulative_cure;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }
    @Override
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getNewConfirmedCases() {
        return newConfirmedCases;
    }

    public void setNewConfirmedCases(Integer newConfirmedCases) {
        this.newConfirmedCases = newConfirmedCases;
    }

    public Integer getNewDeaths() {
        return newDeaths;
    }

    public void setNewDeaths(Integer newDeaths) {
        this.newDeaths = newDeaths;
    }

    public Integer getExistingConfirmedDiagnosis() {
        return existingConfirmedDiagnosis;
    }

    public void setExistingConfirmedDiagnosis(Integer existingConfirmedDiagnosis) {
        this.existingConfirmedDiagnosis = existingConfirmedDiagnosis;
    }

    public Integer getCumulativeDiagnosis() {
        return cumulativeDiagnosis;
    }

    public void setCumulativeDiagnosis(Integer cumulativeDiagnosis) {
        this.cumulativeDiagnosis = cumulativeDiagnosis;
    }

    public Integer getCumulativeDeaths() {
        return cumulativeDeaths;
    }

    public void setCumulativeDeaths(Integer cumulativeDeaths) {
        this.cumulativeDeaths = cumulativeDeaths;
    }

    public Integer getCumulative_cure() {
        return cumulative_cure;
    }

    public void setCumulative_cure(Integer cumulative_cure) {
        this.cumulative_cure = cumulative_cure;
    }

    @Override
    public String toString() {
        return "[链表的使用.Abroad:" +
                "id=" + id +
                ", name='" + name  +
                ", newConfirmedCases=" + newConfirmedCases +
                ", newDeaths=" + newDeaths +
                ", existingConfirmedDiagnosis=" + existingConfirmedDiagnosis +
                ", cumulativeDiagnosis=" + cumulativeDiagnosis +
                ", cumulativeDeaths=" + cumulativeDeaths +
                ", cumulative_cure=" + cumulative_cure +"]";
    }

}

Organization

package Java映射;

import 链表的使用.Area;

public class Organization implements Area {
    private Integer id;
    private String name;

    private Integer newConfirmedCases;
    private Integer cumulativeDiagnosis;
    private Integer existingConfirmedDiagnosis;
    private Integer isValId;
    private String provinceName;
    private String cityName;
    private People[] users;
    public Organization() {
    }

    public Organization(Integer id, String name) {
        this.id = id;
        this.name = name;
    }

    public Organization(Integer id, String name, Integer newConfirmedCases, Integer cumulativeDiagnosis, Integer existingConfirmedDiagnosis, Integer isValId) {
        this.id = id;
        this.name = name;
        this.newConfirmedCases = newConfirmedCases;
        this.cumulativeDiagnosis = cumulativeDiagnosis;
        this.existingConfirmedDiagnosis = existingConfirmedDiagnosis;
        this.isValId = isValId;
    }

    public Organization(Integer id, String name, Integer newConfirmedCases, Integer cumulativeDiagnosis, Integer existingConfirmedDiagnosis, Integer isValId, String provinceName, String cityName, People[] users) {
        this.id = id;
        this.name = name;
        this.newConfirmedCases = newConfirmedCases;
        this.cumulativeDiagnosis = cumulativeDiagnosis;
        this.existingConfirmedDiagnosis = existingConfirmedDiagnosis;
        this.isValId = isValId;
        this.provinceName = provinceName;
        this.cityName = cityName;
        this.users = users;
    }

    public Integer getId() {
        return id;
    }

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

    @Override
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getNewConfirmedCases() {
        return newConfirmedCases;
    }

    public void setNewConfirmedCases(Integer newConfirmedCases) {
        this.newConfirmedCases = newConfirmedCases;
    }

    public Integer getCumulativeDiagnosis() {
        return cumulativeDiagnosis;
    }

    public void setCumulativeDiagnosis(Integer cumulativeDiagnosis) {
        this.cumulativeDiagnosis = cumulativeDiagnosis;
    }

    public Integer getExistingConfirmedDiagnosis() {
        return existingConfirmedDiagnosis;
    }

    public void setExistingConfirmedDiagnosis(Integer existingConfirmedDiagnosis) {
        this.existingConfirmedDiagnosis = existingConfirmedDiagnosis;
    }

    public Integer getIsValId() {
        return isValId;
    }

    public void setIsValId(Integer isValId) {
        this.isValId = isValId;
    }

    public String getProvinceName() {
        return provinceName;
    }

    public void setProvinceName(String provinceName) {
        this.provinceName = provinceName;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public People[] getUsers() {
        return users;
    }

    public void setUsers(People[] users) {
        this.users = users;
    }

    @Override
    public String toString() {
        return "Organization{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", newConfirmedCases=" + newConfirmedCases +
                ", cumulativeDiagnosis=" + cumulativeDiagnosis +
                ", existingConfirmedDiagnosis=" + existingConfirmedDiagnosis +
                ", isValId=" + isValId +
                ", provinceName='" + provinceName + '\'' +
                ", cityName='" + cityName + '\'' +
                '}';
    }
}

MyCountry

package Java映射;

import 链表的使用.Area;

public abstract class MyCountry implements Area {
    People[] getUsers() {
        return null;
    }

    Area[] getOrganizations() {
        return null;
    }

}

City

package Java映射;

import 链表的使用.Area;

public class City extends MyCountry {
    private Integer id;
    private String name;
    private Integer addLocal;
    private Integer newLocalAsymptomatic;
    private Integer existingConfirmedDiagnosis;
    private Integer cumulativeDiagnosis;
    private Integer cumulativeCure;
    private Integer cumulativeDeaths;
    private String proviceName;
    private Area[] organizations;
    private People[] users;
    private Integer isValId;

    public City() {
    }

    public City(Integer id, String name) {
        this.id = id;
        this.name = name;
    }

    public City(Integer id, String name, Integer addLocal, Integer newLocalAsymptomatic, Integer existingConfirmedDiagnosis, Integer cumulativeDiagnosis, Integer cumulativeCure, Integer cumulativeDeaths, Integer isValId) {
        this.id = id;
        this.name = name;
        this.addLocal = addLocal;
        this.newLocalAsymptomatic = newLocalAsymptomatic;
        this.existingConfirmedDiagnosis = existingConfirmedDiagnosis;
        this.cumulativeDiagnosis = cumulativeDiagnosis;
        this.cumulativeCure = cumulativeCure;
        this.cumulativeDeaths = cumulativeDeaths;
        this.isValId = isValId;
    }

    public City(Integer id, String name, Integer addLocal, Integer newLocalAsymptomatic, Integer existingConfirmedDiagnosis, Integer cumulativeDiagnosis, Integer cumulativeCure, Integer cumulativeDeaths, String provinceName, Area[] organizations, People[] users, Integer isValId) {
        this.id = id;
        this.name = name;
        this.addLocal = addLocal;
        this.newLocalAsymptomatic = newLocalAsymptomatic;
        this.existingConfirmedDiagnosis = existingConfirmedDiagnosis;
        this.cumulativeDiagnosis = cumulativeDiagnosis;
        this.cumulativeCure = cumulativeCure;
        this.cumulativeDeaths = cumulativeDeaths;
        this.proviceName = provinceName;
        this.organizations = organizations;
        this.users = users;
        this.isValId = isValId;
    }

    public Integer getId() {
        return id;
    }

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

    @Override
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAddLocal() {
        return addLocal;
    }

    public void setAddLocal(Integer addLocal) {
        this.addLocal = addLocal;
    }

    public Integer getNewLocalAsymptomatic() {
        return newLocalAsymptomatic;
    }

    public void setNewLocalAsymptomatic(Integer newLocalAsymptomatic) {
        this.newLocalAsymptomatic = newLocalAsymptomatic;
    }

    public Integer getExistingConfirmedDiagnosis() {
        return existingConfirmedDiagnosis;
    }

    public void setExistingConfirmedDiagnosis(Integer existingConfirmedDiagnosis) {
        this.existingConfirmedDiagnosis = existingConfirmedDiagnosis;
    }

    public Integer getCumulativeDiagnosis() {
        return cumulativeDiagnosis;
    }

    public void setCumulativeDiagnosis(Integer cumulativeDiagnosis) {
        this.cumulativeDiagnosis = cumulativeDiagnosis;
    }

    public Integer getCumulativeCure() {
        return cumulativeCure;
    }

    public void setCumulativeCure(Integer cumulativeCure) {
        this.cumulativeCure = cumulativeCure;
    }

    public Integer getCumulativeDeaths() {
        return cumulativeDeaths;
    }

    public void setCumulativeDeaths(Integer cumulativeDeaths) {
        this.cumulativeDeaths = cumulativeDeaths;
    }

    public String getProviceName() {
        return proviceName;
    }

    public void setProviceName(String proviceName) {
        this.proviceName = proviceName;
    }

    @Override
    public Area[] getOrganizations() {
        return organizations;
    }

    public void setOrganizations(Area[] organizations) {
        this.organizations = organizations;
    }

    @Override
    public People[] getUsers() {
        return users;
    }

    public void setUsers(People[] users) {
        this.users = users;
    }

    public Integer getIsValId() {
        return isValId;
    }

    public void setIsValId(Integer isValId) {
        this.isValId = isValId;
    }

    @Override
    public String toString() {
        return "City{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", addLocal=" + addLocal +
                ", newLocalAsymptomatic=" + newLocalAsymptomatic +
                ", existingConfirmedDiagnosis=" + existingConfirmedDiagnosis +
                ", cumulativeDiagnosis=" + cumulativeDiagnosis +
                ", cumulativeCure=" + cumulativeCure +
                ", cumulativeDeaths=" + cumulativeDeaths +
                ", provinceName='" + proviceName + '\'' +
                ", isValId=" + isValId +
                '}';
    }
}

Province

package Java映射;

import 链表的使用.Area;

import java.util.Arrays;

public class Provice extends MyCountry {
    private Integer id;
    private String name;
    private Integer addedLocal;
    private Integer newLocalAsymptomatic;
    private Integer addedOverseas;
    private Integer newConfirmedCases;
    private Integer existingConfirmedDiagnosis;
    private Integer cumulativeDiagnosis;
    private Integer cumulativeCure;
    private Integer cumulativeDeath;
    private People[] users;
    private Area[] organizations;
    private Area[] cities;

    private Integer isValId;

    public Provice() {
    }

    public Provice(Integer id, String name) {
        this.id = id;
        this.name = name;
    }

    public Provice(Integer id, String name, Integer addedLocal, Integer newLocalAsymptomatic, Integer addedOverseas, Integer newConfirmedCases, Integer existingConfirmedDiagnosis, Integer cumulativeDiagnosis, Integer cumulativeCure, Integer cumulativeDeath, Integer isValId) {
        this.id = id;
        this.name = name;
        this.addedLocal = addedLocal;
        this.newLocalAsymptomatic = newLocalAsymptomatic;
        this.addedOverseas = addedOverseas;
        this.newConfirmedCases = newConfirmedCases;
        this.existingConfirmedDiagnosis = existingConfirmedDiagnosis;
        this.cumulativeDiagnosis = cumulativeDiagnosis;
        this.cumulativeCure = cumulativeCure;
        this.cumulativeDeath = cumulativeDeath;
        this.isValId = isValId;
    }

    public Provice(Integer id, String name, Integer addedLocal, Integer newLocalAsymptomatic, Integer addedOverseas, Integer newConfirmedCases, Integer existingConfirmedDiagnosis, Integer cumulativeDiagnosis, Integer cumulativeCure, Integer cumulativeDeath, People[] users, Area[] organizations, Area[] cities, Integer isValId) {
        this.id = id;
        this.name = name;
        this.addedLocal = addedLocal;
        this.newLocalAsymptomatic = newLocalAsymptomatic;
        this.addedOverseas = addedOverseas;
        this.newConfirmedCases = newConfirmedCases;
        this.existingConfirmedDiagnosis = existingConfirmedDiagnosis;
        this.cumulativeDiagnosis = cumulativeDiagnosis;
        this.cumulativeCure = cumulativeCure;
        this.cumulativeDeath = cumulativeDeath;
        this.users = users;
        this.organizations = organizations;
        this.cities = cities;
        this.isValId = isValId;
    }

    public Integer getId() {
        return id;
    }

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

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAddedLocal() {
        return addedLocal;
    }

    public void setAddedLocal(Integer addedLocal) {
        this.addedLocal = addedLocal;
    }

    public Integer getNewLocalAsymptomatic() {
        return newLocalAsymptomatic;
    }

    public void setNewLocalAsymptomatic(Integer newLocalAsymptomatic) {
        this.newLocalAsymptomatic = newLocalAsymptomatic;
    }

    public Integer getAddedOverseas() {
        return addedOverseas;
    }

    public void setAddedOverseas(Integer addedOverseas) {
        this.addedOverseas = addedOverseas;
    }

    public Integer getNewConfirmedCases() {
        return newConfirmedCases;
    }

    public void setNewConfirmedCases(Integer newConfirmedCases) {
        this.newConfirmedCases = newConfirmedCases;
    }

    public Integer getExistingConfirmedDiagnosis() {
        return existingConfirmedDiagnosis;
    }

    public void setExistingConfirmedDiagnosis(Integer existingConfirmedDiagnosis) {
        this.existingConfirmedDiagnosis = existingConfirmedDiagnosis;
    }

    public Integer getCumulativeDiagnosis() {
        return cumulativeDiagnosis;
    }

    public void setCumulativeDiagnosis(Integer cumulativeDiagnosis) {
        this.cumulativeDiagnosis = cumulativeDiagnosis;
    }

    public Integer getCumulativeCure() {
        return cumulativeCure;
    }

    public void setCumulativeCure(Integer cumulativeCure) {
        this.cumulativeCure = cumulativeCure;
    }

    public Integer getCumulativeDeath() {
        return cumulativeDeath;
    }

    public void setCumulativeDeath(Integer cumulativeDeath) {
        this.cumulativeDeath = cumulativeDeath;
    }

    public void setUsers(People[] users) {
        this.users = users;
    }

    public void setOrganizations(Area[] organizations) {
        this.organizations = organizations;
    }

    public Area[] getCities() {
        return cities;
    }

    public void setCities(Area[] cities) {
        this.cities = cities;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public People[] getUsers() {
        return users;
    }

    @Override
    public Area[] getOrganizations() {
        return organizations;
    }

    public Integer getIsValId() {
        return isValId;
    }

    public void setIsValId(Integer isValId) {
        this.isValId = isValId;
    }

    @Override
    public String toString() {
        return "Province{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", addedLocal=" + addedLocal +
                ", newLocalAsymptomatic=" + newLocalAsymptomatic +
                ", addedOverseas=" + addedOverseas +
                ", newConfirmedCases=" + newConfirmedCases +
                ", existingConfirmedDiagnosis=" + existingConfirmedDiagnosis +
                ", cumulativeDiagnosis=" + cumulativeDiagnosis +
                ", cumulativeCure=" + cumulativeCure +
                ", cumulativeDeath=" + cumulativeDeath +
                ", isValId=" + isValId +
                '}';
    }
}

People

package Java映射;

import java.time.LocalDateTime;

public interface  People {
   Integer getId();
   String getNo();
   String getName();
   String getPassword();
   LocalDateTime getCreateTime();
   LocalDateTime getLastTime();
   Integer getResult();
   LocalDateTime getDetectionTime();
   Integer getRoleId();
   Integer getIsValId();
   String getProvinceName();
   String getOrganizationName();
   String getCityName();
}

Admin

package Java映射;

import java.time.LocalDateTime;

public class Admin implements People{
    private Integer id;
    private String no;
    private String password;
    private String name;
    private Integer phone;
    private Integer age;
    private Integer result;
    private String idNumber;
    private LocalDateTime createTime;
    private LocalDateTime lastTime;
    private LocalDateTime detectionTime;
    private String address;
    private Integer roleId;
    private Integer isValId;
    private String provinceName;
    private String organizationName;
    private String cityName;

    public Admin() {
    }

    public Admin(Integer id, String no) {
        this.id = id;
        this.no = no;
    }

    public Admin(Integer id, String no, String password, String name, Integer phone, Integer age, Integer result, String idNumber, LocalDateTime createTime, LocalDateTime lastTime, LocalDateTime detectionTime,Integer roleId, String address, Integer isValId) {
        this.id = id;
        this.no = no;
        this.password = password;
        this.name = name;
        this.phone = phone;
        this.age = age;
        this.result = result;
        this.idNumber = idNumber;
        this.createTime = createTime;
        this.lastTime = lastTime;
        this.detectionTime = detectionTime;
        this.address = address;
        this.roleId = roleId;
        this.isValId = isValId;
    }

    public Admin(Integer id, String no, String password, String name, Integer phone, Integer age, Integer result, String idNumber, LocalDateTime createTime, LocalDateTime lastTime, LocalDateTime detectionTime, String address,Integer roleId, Integer isValId, String provinceName, String organizationName, String cityName) {
        this.id = id;
        this.no = no;
        this.password = password;
        this.name = name;
        this.phone = phone;
        this.age = age;
        this.result = result;
        this.idNumber = idNumber;
        this.createTime = createTime;
        this.lastTime = lastTime;
        this.detectionTime = detectionTime;
        this.address = address;
        this.roleId = roleId;
        this.isValId = isValId;
        this.provinceName = provinceName;
        this.organizationName = organizationName;
        this.cityName = cityName;
    }

    @Override
    public Integer getId() {
        return id;
    }

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

    @Override
    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    @Override
    public String getPassword() {
        return password;
    }

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

    @Override
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getPhone() {
        return phone;
    }

    public void setPhone(Integer phone) {
        this.phone = phone;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    @Override
    public Integer getResult() {
        return result;
    }

    public void setResult(Integer result) {
        this.result = result;
    }

    public String getIdNumber() {
        return idNumber;
    }

    public void setIdNumber(String idNumber) {
        this.idNumber = idNumber;
    }

    @Override
    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    @Override
    public LocalDateTime getLastTime() {
        return lastTime;
    }

    public void setLastTime(LocalDateTime lastTime) {
        this.lastTime = lastTime;
    }

    @Override
    public LocalDateTime getDetectionTime() {
        return detectionTime;
    }

    public void setDetectionTime(LocalDateTime detectionTime) {
        this.detectionTime = detectionTime;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @Override
    public Integer getRoleId() {
        return roleId;
    }
    public void setReloId(Integer roleId){
        this.roleId=roleId;
    }
    @Override
    public Integer getIsValId() {
        return isValId;
    }

    public void setIsValId(Integer isValId) {
        this.isValId = isValId;
    }

    public String getProvinceName() {
        return provinceName;
    }

    public void setProviceName(String provinceName) {
        this.provinceName = provinceName;
    }

    @Override
    public String getOrganizationName() {
        return organizationName;
    }

    public void setOrganizationName(String organizationName) {
        this.organizationName = organizationName;
    }

    @Override
    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    @Override
    public String toString() {
        return "Admin{" +
                "id=" + id +
                ", no='" + no + '\'' +
                ", password='" + password + '\'' +
                ", name='" + name + '\'' +
                ", phone=" + phone +
                ", age=" + age +
                ", result=" + result +
                ", idNumber='" + idNumber + '\'' +
                ", createTime=" + createTime +
                ", lastTime=" + lastTime +
                ", detectionTime=" + detectionTime +
                ", address='" + address + '\'' +
                ", roleId=" + roleId +
                ", isValId=" + isValId +
                ", provinceName='" + provinceName + '\'' +
                ", organizationName='" + organizationName + '\'' +
                ", cityName='" + cityName + '\'' +
                '}';
    }
}

User

package Java映射;

import java.time.LocalDateTime;

public class User implements People{
    private static final Integer RELOID = 2;
    private Integer id;
    private String no;
    private String password;
    private String name;
    private Integer phone;
    private Integer age;
    private Integer result;
    private String idNumber;
    private LocalDateTime createTime;
    private LocalDateTime lastTime;
    private LocalDateTime detectionTime;
    private String address;
    private Integer roleId;
    private Integer isValId;
    private String provinceName;
    private String organizationName;
    private String cityName;

    public User() {
    }

    public User(Integer id, String no) {
        this.id = id;
        this.no = no;
    }

    public User(Integer id, String no, String password, String name, Integer phone, Integer age, Integer result, String idNumber, LocalDateTime createTime, LocalDateTime lastTime, LocalDateTime detectionTime, String address, Integer isValId) {
        this.id = id;
        this.no = no;
        this.password = password;
        this.name = name;
        this.phone = phone;
        this.age = age;
        this.result = result;
        this.idNumber = idNumber;
        this.createTime = createTime;
        this.lastTime = lastTime;
        this.detectionTime = detectionTime;
        this.address = address;
        this.roleId = RELOID;
        this.isValId = isValId;
    }

    public User(Integer id, String no, String password, String name, Integer phone, Integer age, Integer result, String idNumber, LocalDateTime createTime, LocalDateTime lastTime, LocalDateTime detectionTime, String address, Integer isValId, String provinceName, String organizationName, String cityName) {
        this.id = id;
        this.no = no;
        this.password = password;
        this.name = name;
        this.phone = phone;
        this.age = age;
        this.result = result;
        this.idNumber = idNumber;
        this.createTime = createTime;
        this.lastTime = lastTime;
        this.detectionTime = detectionTime;
        this.address = address;
        this.roleId = RELOID;
        this.isValId = isValId;
        this.provinceName = provinceName;
        this.organizationName = organizationName;
        this.cityName = cityName;
    }

    @Override
    public Integer getId() {
        return id;
    }

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

    @Override
    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    @Override
    public String getPassword() {
        return password;
    }

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

    @Override
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getPhone() {
        return phone;
    }

    public void setPhone(Integer phone) {
        this.phone = phone;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    @Override
    public Integer getResult() {
        return result;
    }

    public void setResult(Integer result) {
        this.result = result;
    }

    public String getIdNumber() {
        return idNumber;
    }

    public void setIdNumber(String idNumber) {
        this.idNumber = idNumber;
    }

    @Override
    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    @Override
    public LocalDateTime getLastTime() {
        return lastTime;
    }

    public void setLastTime(LocalDateTime lastTime) {
        this.lastTime = lastTime;
    }

    @Override
    public LocalDateTime getDetectionTime() {
        return detectionTime;
    }

    public void setDetectionTime(LocalDateTime detectionTime) {
        this.detectionTime = detectionTime;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @Override
    public Integer getRoleId() {
        return roleId;
    }
    @Override
    public Integer getIsValId() {
        return isValId;
    }

    public void setIsValId(Integer isValId) {
        this.isValId = isValId;
    }

    public String getProvinceName() {
        return provinceName;
    }

    public void setProviceName(String provinceName) {
        this.provinceName = provinceName;
    }

    @Override
    public String getOrganizationName() {
        return organizationName;
    }

    public void setOrganizationName(String organizationName) {
        this.organizationName = organizationName;
    }

    @Override
    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", no='" + no + '\'' +
                ", password='" + password + '\'' +
                ", name='" + name + '\'' +
                ", phone=" + phone +
                ", age=" + age +
                ", result=" + result +
                ", idNumber='" + idNumber + '\'' +
                ", createTime=" + createTime +
                ", lastTime=" + lastTime +
                ", detectionTime=" + detectionTime +
                ", address='" + address + '\'' +
                ", roleId=" + roleId +
                ", isValId=" + isValId +
                ", provinceName='" + provinceName + '\'' +
                ", organizationName='" + organizationName + '\'' +
                ", cityName='" + cityName + '\'' +
                '}';
    }
}


测试

package Java映射;

public class JavaTest01 {
    public static void main(String[] args) {
        Provice province01 = new Provice(1,"四川省");
        City city01 = new City(1,"成都市");
        Organization organization01 = new Organization(1,"学校01");
        Organization organization02 = new Organization(2,"学校02");
        User user01 = new User(1,"no10001");
        User user02 = new User(2,"no10002");
        User user03 = new User(3,"no10003");
        User user04 = new User(4,"no10004");
        User user05 = new User(5,"no10005");

        user01.setOrganizationName(organization01.getName());
        user02.setOrganizationName(organization01.getName());
        user03.setOrganizationName(organization01.getName());
        user04.setOrganizationName(organization02.getName());
        user05.setOrganizationName(organization02.getName());
        user01.setCityName(city01.getName());
        user02.setCityName(city01.getName());
        user03.setCityName(city01.getName());
        user04.setCityName(city01.getName());
        user05.setCityName(city01.getName());
        user01.setProviceName(province01.getName());
        user02.setProviceName(province01.getName());
        user03.setProviceName(province01.getName());
        user04.setProviceName(province01.getName());
        user05.setProviceName(province01.getName());

        organization01.setCityName(city01.getName());
        organization02.setCityName(city01.getName());
        organization01.setProvinceName(province01.getName());
        organization02.setProvinceName(province01.getName());
        organization01.setUsers(new User[]{user01,user02,user03});
        organization02.setUsers(new User[]{user04,user05});

        city01.setOrganizations(new Organization[]{organization01,organization02});
        city01.setUsers(new User[]{user01,user02,user03,user04,user05});

        province01.setOrganizations(new Organization[]{organization01,organization02});
        province01.setCities(new City[]{city01});
        province01.setUsers(new User[]{user01,user02,user03,user04,user05});


        System.out.println(province01);
        System.out.println(user01);
    }
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值