您的位置:首页 > 其它

hql语句修改部分字段

2014-03-12 15:28 169 查看


Hibernate
hql语句修改部分字段

 
Dao中的封装方法如下:
public [b]int update(final String hql, final Object[] params){[/b]
   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()});
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: