HHH-15784 Fix primitive array as NaturalId.
This commit is contained in:
parent
f13c69fb63
commit
81d9707f61
|
@ -114,7 +114,8 @@ public class SimpleNaturalIdMapping extends AbstractNaturalIdMapping implements
|
|||
return;
|
||||
}
|
||||
|
||||
if ( naturalIdValue.getClass().isArray() ) {
|
||||
final Class<?> naturalIdValueClass = naturalIdValue.getClass();
|
||||
if ( naturalIdValueClass.isArray() && !naturalIdValueClass.getComponentType().isPrimitive() ) {
|
||||
// be flexible
|
||||
final Object[] values = (Object[]) naturalIdValue;
|
||||
if ( values.length == 1 ) {
|
||||
|
@ -128,7 +129,7 @@ public class SimpleNaturalIdMapping extends AbstractNaturalIdMapping implements
|
|||
Locale.ROOT,
|
||||
"Incoming natural-id value [%s (`%s`)] is not of expected type [`%s`] and could not be coerced",
|
||||
naturalIdValue,
|
||||
naturalIdValue.getClass().getName(),
|
||||
naturalIdValueClass.getName(),
|
||||
getJavaType().getJavaType().getTypeName()
|
||||
)
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue