hibernate 中 update 与 createQuery(hql).executeUpdate(); 区别
在hubernate中 update 更新比较繁琐,如果只更新一个字段,使用sql 语句的形式是最好的选择
但是在实战中,使用 createQuery(hql).executeUpdate(); 去更新指定字段的信息,但是却无法
更新,是直接不执行.解决方案有很多。
建议使用hubernate 自带update去更新指定的字段信息。
hibernate 中 update 与 createQuery(hql).executeUpdate(); 区别
在hubernate中 update 更新比较繁琐,如果只更新一个字段,使用sql 语句的形式是最好的选择
但是在实战中,使用 createQuery(hql).executeUpdate(); 去更新指定字段的信息,但是却无法
更新,是直接不执行.解决方案有很多。
建议使用hubernate 自带update去更新指定的字段信息。