Reference Address: http://blog.csdn.net/ml5271169588/article/details/6734981
According to the online content summarized as follows:
Update
Update tablename set ... where id=?
Merge
The record is first queried based on the ID, and if the data to be updated is the same as the queried data, there is no UPDATE statement.
If the data is not queried based on the ID, there is an insert record,
The following are excerpts from the Web:
When we use update, the state of the object A that we provide becomes persisted after execution is complete.
But when we use the merge, the execution is done, we provide the object A is still out of the tube State, hibernate or new a B, or retrieve a persistent object B, and we provide a copy of all the values of object A to this B, after the completion of the implementation of B is a persistent state, And the A we provide is a managed state.
**
Update and merge