读书人

spring的hibernateTemplate中施行sql语

发布时间: 2012-08-27 21:21:57 作者: rapoo

spring的hibernateTemplate中执行sql语句

org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here
?

注意此处要用openSession!

?

this.getHibernateTemplate().getSessionFactory().openSession().createSQLQuery(sql).executeUpdate();

读书人网 >SQL Server

热点推荐