• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SQLException: Invalid value for getInt() + scrambled columns

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

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?

Karsten
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic