public class Customer {
private Integer id;
private String name;
private Set<Order> orders = new HashSet<Order>();
}
public class Customer {
private Integer id;
private String name;
private List<Order> list;
}
你也可以写成,private List<Order> list = new ArrayList<Order>();
这个写法应该是按照自己习惯来写的