We're updating the issue view to help you get more done. 

Regression: Ambiguous attribute converters as converter for parent type is also asigned

Description

I have two custom datatypes: A and B where B extends A.
Also I do have AAttributeConverter for A and BAttributeConverter for B (both with @Converter(autoApply = true)).
This scenario works fine with hibernate 5.0.9.Final.
However, when I update to recent 5.2.8.Final I get this error:

1 2 3 4 Caused by: java.lang.RuntimeException: Multiple auto-apply converters matched attribute [com.example.MyBean.value] : com.example.AAttributeConverter, com.example.BAttributeConverter at org.hibernate.boot.internal.AttributeConverterManager.findAutoApplyConverterForAttribute(AttributeConverterManager.java:93) at org.hibernate.cfg.AbstractPropertyHolder.resolveAttributeConverterDescriptor(AbstractPropertyHolder.java:96) ...

The property MyBean.value has type B that extends A. As BAttributeConverter is more specific and AAttributeConverter can not actually handle B hibernate should IMHO not consider AAttributeConverter here.

Environment

None

Status

Assignee

Unassigned

Reporter

Jörg Hohwiller

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

5.0.9

Components

Affects versions

5.2.8

Priority

Major