AttributeConverted sometimes does not work in Hibernate 6.

Description

I have this repository:


 

The exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.math.BigDecimal] to type [cz.tconsult.problem.MyNumber] for value [579], is throwen by spring. But it is throwen, because the Hibernate does not call in the second method the MyNumberAttributeConverter.
The first method works and the MyNumberAttributeConverter is called.
The differece between these methods are only in the query. The failing query has some expression in the select clause.


 

The same construction worked in hibernate 5 (springboot 3).

The attachement contains small application with demonstrating tests.

Attachments

2

Activity

Show:

Gavin King April 12, 2024 at 1:22 PM

This is similar to and .

has, I believe, already looked at this and perhaps fixed it.

In future, please make sure that reproducers involve pure Hibernate code, with no Spring repositories or dependencies on Spring.

Details

Assignee

Reporter

Labels

Worked in

Affects versions

Priority

Created April 12, 2024 at 11:55 AM
Updated April 12, 2024 at 1:22 PM