Forums Register Login

SQLException: Invalid value for getInt() + scrambled columns

+Pie Number of slices to send: Send
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
Are you okay? You look a little big. Maybe this tiny ad will help:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 4663 times.
Similar Threads
java.lang.OutOfMemoryError: Java heap space
NullPointerException in hibernate PersistentBag.getSnapshot()
MySQL + Hibernate: HTTP servlet broken pipe with entity manager
Entity manager: Hibernate generating wrong SQL (composite key of composite keys)
session interrupe for the big file
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 00:44:18.