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.

Environment

None

Activity

Show:
Leuteris Katiforis
May 17, 2020, 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:

Steven Walters
May 17, 2020, 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.

Assignee

Unassigned

Reporter

Steven Walters

Fix versions

Labels

None

backPortable

Backport?

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure