HHH-18012 Fix array type matching for auto applying AttributeConverter

This commit is contained in:
Yanming Zhou 2024-04-25 15:20:13 +08:00 committed by Christian Beikov
parent 9905a30852
commit f2d086f0dc
1 changed files with 8 additions and 0 deletions

View File

@ -125,6 +125,14 @@ public class ConverterHelper {
if ( erasedCheckType.isPrimitive() ) { if ( erasedCheckType.isPrimitive() ) {
erasedCheckType = PrimitiveWrapperHelper.getDescriptorByPrimitiveType( erasedCheckType ).getWrapperClass(); erasedCheckType = PrimitiveWrapperHelper.getDescriptorByPrimitiveType( erasedCheckType ).getWrapperClass();
} }
else if ( erasedCheckType.isArray() ) {
// converterDefinedType have type parameters if it extends super generic class
// but checkType doesn't have any type parameters
// comparing erased type is enough
// see https://hibernate.atlassian.net/browse/HHH-18012
return converterDefinedType.getErasedType() == erasedCheckType;
}
if ( !converterDefinedType.getErasedType().isAssignableFrom( erasedCheckType ) ) { if ( !converterDefinedType.getErasedType().isAssignableFrom( erasedCheckType ) ) {
return false; return false;
} }