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()});
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()});
相关文章推荐
- hibernate使用createQuery(hql)语句仅查询部分字段,应如何获得数据
- hql语句修改部分字段
- Hibernate查询部分字段并封装到指定类中(HQL)
- hibernate中利用hql查询部分字段
- Hibernate查询部分字段并封装到指定类中(HQL)
- Hibernate中用hql查询部分字段
- Hibernate中用hql查询部分字段
- Hibernate中用hql查询部分字段
- Hibernate中用hql查询部分字段 可解决异常java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to
- Hibernate HQL 查询POJO部分字段
- Hibernate中HQL语句查询指定字段值报错:ClassCastException: [java.lang.Object; cannot be cast to bean.PersonStatic
- Hibernate中如何用HQL查询部分字段
- Hibernate中用hql查询部分字段
- sql语句修改某个字段的部分内容
- Hibernate中用hql查询部分字段 可解决异常java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to
- Hibernate 之 hql 语句执行字段过滤查询
- Hibernate中用hql查询部分字段
- Hibernate中用hql查询部分字段 可解决异常java.lang.ClassCastException: cannot be cast to
- Hibernate中用hql查询部分字段
- Hibernate中用hql查询部分字段