Skip to content

Commit aeab7ac

Browse files
quaffbeikov
authored andcommitted
HHH-18012 Fix array type matching for auto applying AttributeConverter
1 parent 5bf7789 commit aeab7ac

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

hibernate-core/src/main/java/org/hibernate/boot/model/convert/internal/ConverterHelper.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,14 @@ public static boolean typesMatch(ResolvedType converterDefinedType, ResolvedType
125125
if ( erasedCheckType.isPrimitive() ) {
126126
erasedCheckType = PrimitiveWrapperHelper.getDescriptorByPrimitiveType( erasedCheckType ).getWrapperClass();
127127
}
128+
else if ( erasedCheckType.isArray() ) {
129+
// converterDefinedType have type parameters if it extends super generic class
130+
// but checkType doesn't have any type parameters
131+
// comparing erased type is enough
132+
// see https://hibernate.atlassian.net/browse/HHH-18012
133+
return converterDefinedType.getErasedType() == erasedCheckType;
134+
}
135+
128136
if ( !converterDefinedType.getErasedType().isAssignableFrom( erasedCheckType ) ) {
129137
return false;
130138
}

0 commit comments

Comments
 (0)