When attempting to use an AttributeConverter that converts the attribute to a Byte type, hibernate generates an error of
Caused by: org.hibernate.MappingException: No Dialect mapping for JDBC type: 1998767043
Where the integer value listed seems to be some random value.
However, using Short, works.
On several projects, we're wanting to utilize byte values to store enumerated types instead of inefficient text strings.
For now, we're working around it by using Short instead, but obviously this uses double the size per enum per row.
I've attached a small test project to exemplify the issue. can use
to run with 5.3.17.Final, 5.4.15.Final, and 6.0.0.Alpha5 respectively.
Thanks for the detailed description @Steven Walters. According to JDBC API Specification (TABLE B-2), the Java type Byte is mapped to JDBC type TINYINT. I 've added the above mapping and the test runs successfully. Please find my PR at:
Hi Leuteris, thank you for looking into this.
I’m not that familiar with the hibernate codebase, but yes TINYINT would be most correct for Byte.
And looking at the new test cases, it appears to exemplify the issue I raised.
Overall, it looks like a correct fix and verification to the problem at hand.