N对一,对应对象。
如:Student类对应Class类(一个学生对应一个班级)
public class Student {
private Integer sId;
private String sName;
private Integer age;
private String gender;
private Clazz clazz;//班级。一对一
...//get和set方法...
}
N对多,对应集合。
如:Class类对应Student类(一个班级对应多个学生)
public class Clazz {
private Integer cid;
private String cname;
private List<Student> studentLis;
...//get和set方法...
}
标签:...,String,private,bean,Student,Integer,一对,对应
From: https://www.cnblogs.com/SuSVIP/p/17094121.html