hibernatetemplate的一个问题 麻烦问大家一下,我在使用hibernatetemplate的时候,想要执行一个语句比如 delete from 表 where user_name=? and password =? 。这个时候我就想要用hql或者其他方式,此时大家在公司里边都是怎么做的?是用hibernatetemplate获得sessionfactory然后获得session接着获得query然后再用hql吗?还是有其他更好的方法,我目前就是用的上述方法 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我这样用hibernateTemplate.execute(new HibernateCallback(){public Object doInHibernate(Session session) throws HibernateException, SQLException {Query query = session.createQuery("delete.......");query.executeUpdate();return null;}}); 论坛的引用回复功能怎么做呀?求高手解答.... 全文检索的例子,运行时候一直报错 请介绍一些网站流量统计的方法 生成大数据量XMl时内存溢出问题 珍藏的最全的JAVA面试题 Xfire spring和hibernate集成抛出的数据映射异常的问题? struts1一个很奇葩的情况 web工程获取项目路径出错。 struts中在action中如何读取如struts-config.xml或则自己配置的xml里边的信息? 在数据库连接正常的情况下,使用 rs.last(); 为什么出现500错误? java有个大问题?急急急。。。 ssh2框架中,通过spring管理事务,一般将事务管理到哪一层
hibernateTemplate.execute(new HibernateCallback(){
public Object doInHibernate(Session session) throws HibernateException, SQLException {
Query query = session.createQuery("delete.......");
query.executeUpdate();
return null;
}
});