hibernate中merge()、attachDirty()、attachClean()
来源:互联网 发布:linux配置jre环境变量 编辑:程序博客网 时间:2024/05/29 16:41
** * 将传入的detached状态的对象的属性复制到持久化对象中,并返回该持久化对象 * 如果该session中没有关联的持久化对象,加载一个,如果传入对象未保存,保存一个副本并作为持久对象返回,传入对象依然保持detached状态。 * @see com.CodeDepts */ public CodeDepts merge(CodeDepts detachedInstance) { log.debug("merging CodeDepts instance"); try { CodeDepts result = (CodeDepts) getSession() .merge(detachedInstance); log.debug("merge successful"); return result; } catch (RuntimeException re) { log.error("merge failed", re); throw re; } } /** * 将传入的对象持久化并保存。 * 如果对象未保存(Transient状态),调用save方法保存。如果对象已保存(Detached状态),调用update方法将对象与Session重新关联。 * @see com.CodeDepts */ public void attachDirty(CodeDepts instance) { log.debug("attaching dirty CodeDepts instance"); try { getSession().saveOrUpdate(instance); log.debug("attach successful"); } catch (RuntimeException re) { log.error("attach failed", re); throw re; } } /** * 将传入的对象状态设置为Transient状态 * @see com.CodeDepts */ public void attachClean(CodeDepts instance) { log.debug("attaching clean CodeDepts instance"); try { getSession().lock(instance, LockMode.NONE); log.debug("attach successful"); } catch (RuntimeException re) { log.error("attach failed", re); throw re; } }
| 评论
- hibernate中merge()、attachDirty()、attachClean()
- Hibernate状态 (merge,attachDirty,attachClean)
- Hibernate状态 (merge,attachDirty,attachClean)
- Hibernate状态 (merge,attachDirty,attachClean)
- Hibernate状态 (merge,attachDirty,attachClean
- Hibernate状态 (merge,attachDirty,attachClean
- Hibernate状态 (merge,attachDirty,attachClean)
- Hibernate状态 (merge,attachDirty,attachClean)解析
- merge,attachDirty,attachClean
- merge,attachDirty,attachClean
- merge attachDirty attachClean用法
- merge attachDirty attachClean用法.
- merge attachDirty attachClean用法
- Hibernate 中的attachDirty,attachClean,merge,findByProperty和findByExample
- IDE自动生成merge,attachDirty,attachClean作用
- 关于Hibernate的merge() attachDirty() attachClean()三种方法比较使用
- hibernate自动生成的DAO类中的merge() attachDirty() attachClean()方法简单介绍
- Hibernate中merge、saveOrUpdate、save、persist
- uva-457-Linear Cellular Automata
- 第一个spring加强
- 通过Python脚本自动发布ArcGIS服务
- Android入门:Button
- Android开发常用的Intent的URI及示例
- hibernate中merge()、attachDirty()、attachClean()
- 排序
- BP神经网络拟合sin()
- 详解virtual table
- struts2的URL自定义 根据用户使用不同的URL
- C语言常用转义字符
- 最小二乘法 - LS
- 十进制转二进制
- Windows 8 在 Oracle VM VirtualBox(77440) 的安装