Results 1 to 2 of 2

Thread: How does getHibernateTemplate().save(...) work?

  1. #1
    Join Date
    Aug 2004
    Posts
    5

    Default 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. #2
    Join Date
    Aug 2004
    Location
    Toronto, Canada
    Posts
    736

    Default

    All this does is call Hibernate's Session.save(). This actually has nothing to do with Spring, so please take a look at the Hibernate docs, which are pretty extensive.
    Colin Sampaleanu
    SpringSource - http://www.springsource.com

Similar Threads

  1. Replies: 1
    Last Post: Aug 1st, 2005, 01:52 AM
  2. Replies: 3
    Last Post: Dec 22nd, 2004, 02:30 PM
  3. Spring can't work on Eclipse
    By ryanhowai in forum Architecture
    Replies: 1
    Last Post: Nov 9th, 2004, 06:50 AM
  4. Comminting JFormattedTextField dont work
    By besbello in forum Swing
    Replies: 1
    Last Post: Sep 18th, 2004, 09:21 AM
  5. Replies: 2
    Last Post: Sep 7th, 2004, 07:02 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •