Results 1 to 2 of 2

Thread: Identity Key Retrieval after saveOrUpdate

  1. #1
    Join Date
    Aug 2004
    Location
    Brazil
    Posts
    5

    Default Identity Key Retrieval after saveOrUpdate

    i have a generic DAO which uses the getHibernateTemplate().saveOrUpdate() to save objects to my sql server db.

    after saving, i need to get a handle on the id that was generated... but how!?

    I KNOW this is easy!!!

    thanks,
    ~plucas

  2. #2
    Join Date
    Aug 2004
    Location
    Brazil
    Posts
    5

    Default

    nevermind - i am dumb.

    the object is automatically reloaded after saving.... thus if it had an empty id before the save, it'll have an assigned id after the save....

    my test was wrong, not my function!!

Similar Threads

  1. Replies: 4
    Last Post: Feb 6th, 2007, 04:15 AM
  2. Replies: 3
    Last Post: Jun 26th, 2005, 09:06 PM
  3. Replies: 1
    Last Post: May 16th, 2005, 08:53 AM
  4. Replies: 3
    Last Post: May 16th, 2005, 07:04 AM
  5. RSA Security Federated Identity (B2B SSO)
    By gtuberson in forum Security
    Replies: 2
    Last Post: Mar 17th, 2005, 04:47 PM

Posting Permissions

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