SpringBoot + MyBatis 内部实体类属性与数据库的对应关系

pojo 类

//部门表
    @Repository
public class Department {
    private Integer id;
    private String departmentName;

//员工表
public class Employee {
    private  Integer id;
    private  String name;
    private String email;
    private Integer gender;//0 女 1男
    private Department department;
    private Date birth;

员工表中有个属性为Department ,员工表中department列该如何设计

整合Mybatis 时 EmployeeMapper.xml department 属性与 数据库对应列关系hai能自动关联么

https://blog.csdn.net/qq_36544760/article/details/79502206

https://blog.csdn.net/qq_37164847/article/details/81001784