首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

HQL中批改对象属性的句子

2012-10-07 
HQL中修改对象属性的句子def newInstance Organization.get(instance.id)def newSql update Organiz

HQL中修改对象属性的句子
def newInstance = Organization.get(instance.id);
def newSql = "update Organization o set organiza='${newInstance.id}' where o.id="+instance.id;
Organization.executeUpdate(newSql);
println "##############"+newSql+"##############";


hibernate 现在的版本应该还是3.x   hibernate 3 不支持insert语句  只支持update delete 和select 三种hql语句,保存的时候可以使用hibernate封装对象,也可以使用session ,所以你要是想找到hibernate 的insert语句除非是hibernate小组又有新的支持更新了,否则,只要是insert语句 就会报异常

热点排行