HHH-14869 Fix CallbackRegistryImpl#registerCallbacks considering all given callbacks have the same type
This commit is contained in:
parent
965f5bd925
commit
8afce5b5ed
|
@ -41,13 +41,15 @@ final class CallbackRegistryImpl implements CallbackRegistryImplementor {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final HashMap<Class, Callback[]> map = determineAppropriateCallbackMap( callbacks[0].getCallbackType() );
|
for ( Callback callback : callbacks ) {
|
||||||
Callback[] entityCallbacks = map.get( entityClass );
|
final HashMap<Class, Callback[]> map = determineAppropriateCallbackMap( callback.getCallbackType() );
|
||||||
|
Callback[] entityCallbacks = map.get( entityClass );
|
||||||
if ( entityCallbacks != null ) {
|
if ( entityCallbacks == null ) {
|
||||||
callbacks = ArrayHelper.join( entityCallbacks, callbacks );
|
entityCallbacks = new Callback[0];
|
||||||
|
}
|
||||||
|
entityCallbacks = ArrayHelper.join( entityCallbacks, callback );
|
||||||
|
map.put( entityClass, entityCallbacks );
|
||||||
}
|
}
|
||||||
map.put( entityClass, callbacks );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue