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

Composite Key and update: update never executed

 
Hans Lesmeister
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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
 
Edvins Reisons
Ranch Hand
Posts: 364
  • Mark post as helpful
  • send pies
  • 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
  • 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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic