I am new to Hibernate and went through the Hibernate tutorial last week. I have a few doubts about methods save, update, saveOrUpdate and merge in the Session class. These a
You are exactly right in all of your assessments. You get it.
For your first question, if i recall correctly, save
specifically does an insert. So calling save again will result in another row in the db.
For your second question, update
updates an object in the session. So if the object is in the session it will update. If the object is not in the session, you should call merge. I believe calling update
for a detached instance will result in an exception.