通過(guò)hibernateTemplate 使用session : Session session = this.hibernateTemplate.getSessionFactory().openSession();
回調(diào): hibernateTemplate. execute(new HibernateCallback() {
public Object doInHibernate(Session session)
throws HibernateException, SQLException {
//doSomething
}
});