ask a spring framework question# Java - 爪哇娇娃
s*p
1 楼
I user HibernateTemplate to use hibernate. However, I met a problem on
session lost or session close.Basically, I did:
Database relationship: 1 student -> n courses
public class Student {
String studentId;
Collection courses;
...
public Collection getCourses(){
return courses;
}
}
public class StudentDAO {
public Student getStudent(String studentId) {
return getHibernateTemplate().get(Student.class, studentId);
}
}
I can get Student object through StudentDAO.
Student student = (S
session lost or session close.Basically, I did:
Database relationship: 1 student -> n courses
public class Student {
String studentId;
Collection courses;
...
public Collection getCourses(){
return courses;
}
}
public class StudentDAO {
public Student getStudent(String studentId) {
return getHibernateTemplate().get(Student.class, studentId);
}
}
I can get Student object through StudentDAO.
Student student = (S