Announcement Announcement Module
No announcement yet.
How does getHibernateTemplate().save(...) work? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • How does getHibernateTemplate().save(...) work?

    How does the save(..) method of HibernateTemplate really work? I was able to use the find method to obtain a Product object with a primary key of productId, modify it and call save(product) on it. I expected to obtain an exception about trying to save an already existing product, but instead what happened was that the record in the database for that product was updated. I would have thought that I needed to use the update(...) method instead.

  • #2
    All this does is call Hibernate's This actually has nothing to do with Spring, so please take a look at the Hibernate docs, which are pretty extensive.