• 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 ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

SQLException: Invalid value for getInt() + scrambled columns

Ranch Hand
Posts: 106
Hibernate Python MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I'm getting more and more frustrated by Hibernate doing unexplainable things. I get the following exception:

The SQL for the table is:

Here's the entity and composite key class:

If you look at the stack trace line

you can see the order of columns is [clubId, ordinalNbr, teamtypeCode] and {teamtypeCode=mo20, clubId=101, ordinalNbr=1}, but the table (I checked the DB x times) and the class are club_id, teamtype_code, ordinalNbr. My suspicion here is that Hibernate scrambles the columns for whatever reason and where expecting club_id (getInt()) it calls that on teamtype_code and excepts... BTW I'm using a simple call to:

What the hell is Hibernate doing? I have no idea. I'm beginning to believe Hiberate is a poor ORM tool, especially when it comes to mappings and composite primary keys.

Does anyone have an idea what to try to fix this?

Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!