• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

getHibernateTemplate.SaveorUpdate() object

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI every one,

I am trying to update an event in a database, and when i try to update the details of event its working fine but when i try to update the event itself then a new row is getting inserted instead of getting updated.

so if anyone can suggest it will be helpfull.

can i use getHibernateTemplate.update()object instead of the above metioned will that work fine.

I am really new to this hibernate and if anyone can suggest me with any good tutorial to work with all hibernate related manipilations.

thank you very much in advance.

Harish.
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the object you 'update' doesn't have a primary key initialized, then Hibernate will want to create a new row representing that object.

Adding Records with Hibernate: A Simple Tutorial

-Cameron McKenzie
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic