Results 1 to 4 of 4

Thread: [Newbie] If I want the added row ID and removed row ID

  1. #1
    Join Date
    Jun 2007
    Posts
    14

    Default [Newbie] If I want the added row ID and removed row ID

    I wonder how I can get the ID back after database manipulation by using HibernateTemplate.

    I'm keep walking through the API but can't find the way.

    Every helps will be thankful
    Max

  2. #2
    Join Date
    Jan 2007
    Location
    Kuala Lumpur, Malaysia
    Posts
    138

    Default

    Code:
    String key = (String)getHibernateTemplate().save(entity);
    as for the removed row id..
    i don't know..

  3. #3
    Join Date
    Nov 2005
    Location
    Reutlingen, Germany
    Posts
    2,098

    Default

    You are passing the entity to the delete method, so you know in advance the id. When using the save method you get the id returned, it's only actually a Serializable, not necessarily a String.

    Jörg

  4. #4
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,424

    Default

    Quote Originally Posted by Jörg Heinicke View Post
    You are passing the entity to the delete method, so you know in advance the id. When using the save method you get the id returned, it's only actually a Serializable, not necessarily a String.
    Indeed, is there any chance you can explain more about what you are trying to do?
    Last edited by karldmoore; Aug 27th, 2007 at 04:31 PM.
    Barracuda Networks SSL VPN Lead Developer
    http://pramatr.wordpress.com
    http://twitter.com/karldmoore
    http://www.linkedin.com/in/karldmoore
    Any postings are my own opinion, and should not be attributed to my employer or clients.

Posting Permissions

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