• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Index column is null

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am a novice in using Hibernate. We only use this framework because we are handling an existing application that uses it.

Ok. The issue is not happening all the time but it happend 3 times already. In a table, there is a column (like IDX_COLUMN) that has a db property of allow null. In the hibernate mapping, it is defined as index column. When a user tried to save the data, for example, there should be 50 rows or entries to be created. The first 25 rows/entries have a null value for IDX_COLUMN and the rest are ok starting from 26.

The problem here is whenever the app loads the data using hibernatetemplate, it throws an exception bec of the null index. I tried to update those entries and put the correct value for the indeces since it is just a regular field in DB2 database table but when the app executes my UPDATE query, it crashes on that point. But running the update query directly to the database works fine. So i don't know why the app is not allowing my Update query.

Is it really impossible to update it thru code? Or did i miss something like hibernate settings? I read about inverse=true but not sure if that will solve my problem. All I just want to do is to update the index column values with correct ones and not null.

Thanks!



 
Villains always have antidotes. They're funny that way. Here's an antidote disguised as a tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic