一、     表信息

  公司表

cId

cName

cAdress

Null

Null

Null

            表t_company

  员工表 

sId

sName

sAge

cId

Null

Null

Null

Nulls

 

 

            表t_staff

 

  公司-员工:一对多关系,一个公司对应多个员工。外键设在多的一方。

 

二、       实体类

 

Company

package dao;

import java.util.HashSet;
import java.util.Set;

public class Company {
    private Integer cId;
    private String cName;
    private String cAdress;
    private Set<Staff> setStaff = new HashSet<Staff>();
    public Integer getcId() {
        return cId;
    }
    public Set<Staff> getSetStaff() {
        return setStaff;
    }
    public void setSetStaff(Set<Staff> setStaff) {
        this.setStaff = setStaff;
    }
    public void setcId(Integer cId) {
        this.cId = cId;
    }
    public String getcName() {
        return cName;
    }
    public void setcName(String cName) {
        this.cName = cName;
    }
    public String getcAdress() {
        return cAdress;
    }
    public void setcAdress(String cAdress) {
        this.cAdress = cAdress;
    }
}
View Code

相关文章:

  • 2022-12-23
  • 2021-12-23
  • 2022-12-23
  • 2021-04-25
  • 2021-07-29
  • 2021-06-23
  • 2021-08-09
  • 2021-11-11
猜你喜欢
  • 2021-09-05
  • 2022-12-23
  • 2022-02-14
  • 2022-01-13
相关资源
相似解决方案