package com.jcl.pojo2; import java.io.Serializable; import javax.persistence.*; import java.util.List; /** * The persistent class for the DEPT database table. * */ @Entity @NamedQuery(name="Dept.findAll", query="SELECT d FROM Dept d") public class Dept implements Serializable { private static final long serialVersionUID = 1L; @Id private long deptno; private String dname; private String loc; //bi-directional many-to-one association to Emp @OneToMany(mappedBy="dept") private List<Emp> emps; public Dept() { } public long getDeptno() { return this.deptno; } public void setDeptno(long deptno) { this.deptno = deptno; } public String getDname() { return this.dname; } public void setDname(String dname) { this.dname = dname; } public String getLoc() { return this.loc; } public void setLoc(String loc) { this.loc = loc; } public List<Emp> getEmps() { return this.emps; } public void setEmps(List<Emp> emps) { this.emps = emps; } public Emp addEmp(Emp emp) { getEmps().add(emp); emp.setDept(this); return emp; } public Emp removeEmp(Emp emp) { getEmps().remove(emp); emp.setDept(null); return emp; } @Override public String toString() { return "Dept [deptno=" + deptno + ", dname=" + dname + ", loc=" + loc + "]"; } }

wh7019230 LV1
2021年1月28日
1483128871 LV1
2019年4月25日
jiajia91323 LV23
2019年4月22日
最代码官方 LV168
2018年12月9日