Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • 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
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Composite Key and update: update never executed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I have an entity "Stock" with a composite key. Reading from the underlying table works perfectly. But if I try to update a property then no update-SQL is executed. Could somebody please take look if I do something wrong in my mapping file?

Mapping file:


Stock.java:


As I said, selecting data is okay, but updating does not work. Somehow Hibernate does not notice a change in the Pojo and no update-SQL is generated:


Thanks for any help
Regards, Hans
 
Ranch Hand
Posts: 364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The first thing I would do: decide consistently in the mapping and the class definition whether the property is an int or a double.
 
Hans Lesmeister
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mea Culpa, the problem is solved. There was nothing wrong with the mapping and the Hibernate-Setup. There was something wrong with the Testcase. The Testcase did set new values in an existing record, but unfortunately those values where the same as the old values, so nothing really changed and therefore Hibernate did not execute an update. Quite stupid, please take my apolologize for any inconvenience

Regards
Hans
[ March 03, 2008: Message edited by: Hans Lesmeister ]
 
No holds barred. And no bars holed. Except this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic