1.表User id主键,username,password,dept...
表Attendence id主键,uid外键,time...
1 @ManyToOne 2 @JoinColumn(name = "uid",referencedColumnName="id") 3 private User user; 4 5 public User getUser() { 6 return user; 7 } 8 9 public void setUser(User user) { 10 this.user = user; 11 }
2.查询时只需 u.user.id即可
时间: 2024-10-14 06:52:25