hql语句修改部分字段

来源:互联网 发布:电子家谱制作软件 编辑:程序博客网 时间:2024/04/27 19:01

Hibernate hql语句修改部分字段

 

Dao中的封装方法如下:
public int update(final String hql, final Object[] params){
   return super.getHibernateTemplate().bulkUpdate(hql, params);
}

 

Action 中的调用方法如下:
String hql = "update BlogSetting b set b.title=?, b.describale=? where b.id=?";
int n = blogSettingService.update(hql, new Object[]{s.getTitle(), s.getDescribale(), s.getId()});
0 0