public class University {
private String id;
private String name;
private String address;
private List<Student> students;
// setters and getters
}
University
在我从数据库中加载 a 时延迟加载时,JPA 会为我加载它id
的name
、 和address
字段。Students
不会加载。当我调用getStudents()
方法时,JPA 将执行查询
select * from students where universitycode=id
我对延迟加载的理解是否正确?