首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

spring的hibernateTemplate中施行sql语句

2012-08-27 
spring的hibernateTemplate中执行sql语句org.hibernate.HibernateException: No Hibernate Session bound

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();

热点排行