Using AttributeConverter to Byte fails with "No dialect mapping for JBDC Type: <697960108>"

Description

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.

Attachments

1

Activity

Show:

Steven Walters May 17, 2020 at 8:58 AM

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.

Leuteris Katiforis May 17, 2020 at 8:49 AM

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:

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Created May 15, 2020 at 12:12 PM
Updated July 27, 2020 at 3:11 PM
Resolved July 6, 2020 at 10:34 AM