Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getHibernateTemplate.SaveorUpdate() object

 
Harish Ponduri
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • 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.
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic