您的位置:首页 > 其它

Hibernate - hql语句修改部分字段

2012-12-06 21:36 316 查看
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()});
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: