public Object merge(Object object)
1. 如果session中并不存在与参数object具有相同主键的对象,那么首先需要根据主键从数据库中加载出该对象,然后将参数object中的属性拷贝到加载出来的那个对象上面,最后返回该持久化对象,同时需要注意,参数object并没有关联到session上。
2. 如果session中存在与参数object具有相同主键的对象,那么直接将参数object中的属性拷贝到该持久化对象上,然后将该持久化对象返回,同时需要注意,参数object并没有关联到session上。
假设有对象person其属性如下:
person(1, "zhangsan", "123");
当
merge(person);
时,表示它会先从数据库中查询出id和person id值一致的持久化对象
select ... where id = 1
如得到的对象为person2且其属性如下:
person2(1, "lisi", "567");
那么如果它们属性不一样,将person的属性赋给person2
person2(1, "zhangsan","123")
再
return person2
分享到:
相关推荐
The Professional Edition of Merge supports three-way folder comparison, enabling two revisions of a folder hierarchy to be merged with their common ancestor or some other folder hierarchy. This can be...
WinMerge 3 is a port of WinMerge (http://winmerge.org) to use cross-platform with Qt (http://qt.nokia.com/) framework. This project is still in very early stages. WinMerge 3 is LGPL licensed open ...
通过merge-sort算法的实现,掌握外存算法所基于的I/O模型与内存算法基于的RAM模型的区别;理解不同的磁盘访问优化方法是如何提高数据访问性能的。
The Professional Edition of Merge supports three-way folder comparison, enabling two revisions of a folder hierarchy to be merged with their common ancestor or some other folder hierarchy. This can be...
C#例子代码 A0711_MergeC#例子代码 A0711_MergeC#例子代码 A0711_MergeC#例子代码 A0711_MergeC#例子代码 A0711_MergeC#例子代码 A0711_MergeC#例子代码 A0711_MergeC#例子代码 A0711_MergeC#例子代码 A0711_MergeC#...
C#例子代码 A0710_MergeC#例子代码 A0710_MergeC#例子代码 A0710_MergeC#例子代码 A0710_MergeC#例子代码 A0710_MergeC#例子代码 A0710_MergeC#例子代码 A0710_MergeC#例子代码 A0710_MergeC#例子代码 A0710_MergeC#...
Araxis Merge是一款比对软件工具,不仅支持单个文件的比对,而且支持对两个文件夹的所有文件进行对比,并实时修改。用了蛮久感觉很好用,所以分享给大家。 里面给大家内嵌了Araxis Merge v6.5和Araxis Merge 2017两...
address_merge_with_mobile_data.json
Merge two lists of ordered numbers
However, what happens when you're moving to a new system and you want to port your settings and customizations over along with UltraEdit? Add a webpage to your toolbar Use UltraEdit's powerful user ...
merge 比较工具 merge 比较工具merge 比较工具
免费Merge比较工具 win Merge
做项目的时候通常版本与版本比较,因为下一个版本跟前一个版本差一点,可一般我们做多后查不出来,用WinMerge能很简单的查出来增加了哪里........
Hibernate merge、update与saveOrUpdate方法的区别
# how to use ? 包含使用教程,使用中有任何问题可以私信作者。 # For windows:打开 cygwin 终端,执行 vim .bashrc ,键入:alias merge='bash merge文件的路径/merge.sh',保存并退出,再执行:source .bashrc # ...
Araxis Merge 软件入门使用教程 Araxis Merge 软件入门使用教程 Araxis Merge 软件入门使用教程 Araxis Merge 软件入门使用教程 pdf
SIG09 文最新文章:The authors present a method for accurately tracking the moving ...a taffy-pulling animation with many fold and merge events, and stretching and slicing of stiff plastic material.
3.5.3.4 Comparing Working Tree with a branch, a tag or a reference 3.5.3.5 Comparing Working Tree with Any Commit 3.5.3.5.1 From the project explorer: 3.5.3.5.2 From the history view (files only)...
WinMerge文件比较工具,WinMerge文件比较工具
void merge_sort(int A[],int p,int r) { int q; if(p) { q=(p+r)/2;//计算q的值,即将问题拆分成两个子问题; merge_sort(A,p,q); //左半边递归调用merge_sort,缩小问题规模 printf("\n"); //print_A(A...