当前位置: 代码迷 >> SQL >> spring的hibernateTemplate中施行sql语句
  详细解决方案

spring的hibernateTemplate中施行sql语句

热度:95   发布时间:2016-05-05 13:38:38.0
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();
  相关解决方案