• 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
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

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 ]
 
I hired a bunch of ninjas. The fridge is empty, but I can't find them to tell them the mission.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic