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()});
原文地址:https://www.cnblogs.com/cookray/p/2806199.html