<p>Hibernate has a handful of methods that, one way or another, takes your object and puts it into the database. What are the differences between them, when to use which, and why isn't there just one intelligent method that knows when to use what?</p>

<p>The methods that I have identified thus far are:</p>

<ul>
<li><code>save()</code></li>
<li><code>update()</code></li>
<li><code>saveOrUpdate()</code></li>
<li><code>saveOrUpdateCopy()</code></li>
<li><code>merge()</code></li>
<li><code>persist()</code></li>
</ul>

Here's my understanding of the methods.  Mainly these are based on the
API
though as I don't use all of these in practice.
saveOrUpdate
Calls either save or update depending on some checks.  E.g. if no identifier exists, save is called.  Otherwise update is called.
save
Persists an entity.  Will assign an identifier if one doesn't exist.  If one does, it's essentially doing an update.  Returns the generated ID of the entity.
update
Attempts to persist the entity using an existing identifier.  If no identifier exists, I believe an exception is thrown.
saveOrUpdateCopy
This is deprecated and should no longer be used.  Instead there is...
merge
Now this is where my knowledge starts to falter.  The important thing here is the difference between transient, detached and persistent entities.  For more info on the object states,
take a look here
.  With save & update, you are dealing with persistent objects.  They are linked to a Session so Hibernate knows what has changed.  But when you have a transient object, there is no session involved.  In these cases you need to use merge for updates and persist for saving.
persist
As mentioned above, this is used on transient objects.  It does not return the generated ID.