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: {code} 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) ... {code} 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. |
|